From 94b6dff8f74e9cb2a74b21c1d0f7721ef56b0369 Mon Sep 17 00:00:00 2001 From: Tom Adams Date: Thu, 4 Jun 2009 12:39:30 +0100 Subject: [PATCH] s/cookie_file/cookie_dir/g --- examples/scripts/cookies.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/scripts/cookies.sh b/examples/scripts/cookies.sh index 36f1924..4745175 100755 --- a/examples/scripts/cookies.sh +++ b/examples/scripts/cookies.sh @@ -29,10 +29,10 @@ [ -f ./examples/configs/cookies ] && file=./examples/configs/cookies #useful when developing [ -z "$file" ] && exit 1 -[ -d /usr/share/uzbl/examples/data ] && cookie_file=/usr/share/uzbl/examples/data/cookies.d -[ -d $XDG_DATA_HOME/uzbl/ ] && cookie_file=$XDG_DATA_HOME/uzbl/cookies.d -[ -d ./examples/data/ ] && cookie_file=./examples/data/cookies.d #useful when developing -[ -z "$cookie_file" ] && exit 1 +[ -d /usr/share/uzbl/examples/data ] && cookie_dir=/usr/share/uzbl/examples/data/cookies.d +[ -d $XDG_DATA_HOME/uzbl/ ] && cookie_dir=$XDG_DATA_HOME/uzbl/cookies.d +[ -d ./examples/data/ ] && cookie_dir=./examples/data/cookies.d #useful when developing +[ -z "$cookie_dir" ] && exit 1 # if this variable is set, we will use it to inform you when and which cookies we store, and when/which we send. #notifier= @@ -94,13 +94,13 @@ function parse_cookie () { function get_cookie () { path_esc=${path//\//\\/} search="^[^\t]*$host\t[^\t]*\t$path_esc" - cookie=`awk "/$search/" $cookie_file/$host.cookie 2>/dev/null | tail -n 1` + cookie=`awk "/$search/" $cookie_dir/$host.cookie 2>/dev/null | tail -n 1` if [ -z "$cookie" ] then - notify "Get_cookie: search: $search in $cookie_file/$host.cookie -> no result" + notify "Get_cookie: search: $search in $cookie_dir/$host.cookie -> no result" false else - notify "Get_cookie: search: $search in $cookie_file/$host.cookie -> result: $cookie" + notify "Get_cookie: search: $search in $cookie_dir/$host.cookie -> result: $cookie" read domain alow_read_other_subdomains path http_required expiration name value <<< "$cookie" cookie="$name=$value" true @@ -111,8 +111,8 @@ function save_cookie () { if parse_cookie then data="$field_domain\tFALSE\t$field_path\tFALSE\t$field_exp\t$field_name\t$field_value" - notify "save_cookie: adding $data to $cookie_file/$host.cookie" - echo -e "$data" >> $cookie_file/$host.cookie + notify "save_cookie: adding $data to $cookie_dir/$host.cookie" + echo -e "$data" >> $cookie_dir/$host.cookie else notify "not saving a cookie. since we don't have policies yet, parse_cookie must have returned false. this is a bug" fi @@ -132,11 +132,11 @@ function match () { } function fetch_cookie () { - cookie=`cat $cookie_file/$host.cookie` + cookie=`cat $cookie_dir/$host.cookie` } function store_cookie () { - echo $cookie > $cookie_file/$host.cookie + echo $cookie > $cookie_dir/$host.cookie } if match TRUSTED $host -- 1.7.9.5