X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=INSTALL.sh;h=9ba9471efa59e873dd0ecd15fb6cfe8629f4eb75;hb=30395d5065cc3e2d6fdfd3ff8fc9f706135cf5f8;hp=8fd9ebada1064ac4c3bb0012b9d4572ffb4d17ba;hpb=f18bac8374119fa1f3c826e82cfc74ce2ce52dd7;p=brisk.git diff --git a/INSTALL.sh b/INSTALL.sh index 8fd9eba..9ba9471 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -3,6 +3,7 @@ # Defaults # n_players=3 +brisk_debug="TRUE" ftok_path="/var/lib/brisk" web_path="$HOME/brisk" web_only=0 @@ -10,15 +11,20 @@ web_only=0 if [ -f $HOME/.brisk_install ]; then . $HOME/.brisk_install fi - +if [ "x$cookie_path" = "x" ]; then + cookie_path=$web_path +fi function usage () { echo - echo "$1 [-n 3|5] [-w web_dir] [-k ] [-W]" + echo "$1 -h" + echo "$1 [-W] [-n 3|5] [-d TRUE|FALSE] [-w web_dir] [-k ] [-c ]" echo " -h this help" - echo " -n number of players - def. $n_players" + echo " -W web files only" + echo " -n number of players - def. $n_players" + echo " -d activate dabug - def. $brisk_debug" echo " -w dir where place the web tree - def. \"$web_path\"" echo " -k dir where place ftok files - def. \"$ftok_path\"" - echo " -W install web files only" + echo " -c cookie path - def. \"$cookie_path\"" echo } @@ -43,8 +49,10 @@ while [ $# -gt 0 ]; do # echo aa $1 xx $2 bb case $1 in -n*) n_players="`get_param "-n" "$1" "$2"`"; sh=$?;; + -d*) brisk_debug="`get_param "-d" "$1" "$2"`"; sh=$?;; -w*) web_path="`get_param "-w" "$1" "$2"`"; sh=$?;; -k*) ftok_path="`get_param "-k" "$1" "$2"`"; sh=$?;; + -c*) cookie_path="`get_param "-c" "$1" "$2"`"; sh=$?;; -W) web_only=1;; -h) usage $0; exit 0;; *) usage $0; exit 1;; @@ -102,9 +110,10 @@ sed -i "s/^var G_send_time *= *[0-9]\+/var G_send_time = $send_time/g" `find ${w # .ph[ph] substitutions sed -i "s/define *( *PLAYERS_N, *[0-9]\+ *)/define(PLAYERS_N, $n_players)/g" `find ${web_path} -type f -name '*.ph*' -exec grep -l 'define *( *PLAYERS_N, *[0-9]\+ *)' {} \;` -sed -i "s@define *( *FTOK_PATH,[^)]*)@define( FTOK_PATH, \"$ftok_path\")@g" `find ${web_path} -type f -name '*.ph*' -exec grep -l 'define *( *FTOK_PATH,[^)]*)' {} \;` +sed -i "s@define *( *FTOK_PATH,[^)]*)@define(FTOK_PATH, \"$ftok_path\")@g" `find ${web_path} -type f -name '*.ph*' -exec grep -l 'define *( *FTOK_PATH,[^)]*)' {} \;` + +sed -i "s@define *( *BRISK_DEBUG,[^)]*)@define(BRISK_DEBUG, $brisk_debug)@g" ${web_path}/brisk.phh -# install -d ${web_path}/img -# install -m 644 `ls img/*.{jpg,png} | grep -v 'img/src_'` ${web_path}/img +sed -i "s@var \+xhr_rd_cookiepath \+= \+\"[^\"]*\";@var xhr_rd_cookiepath = \"$cookie_path\";@g" ${web_path}/xhr.js exit 0 \ No newline at end of file