diff options
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/init.d/anytun | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/etc/init.d/anytun b/etc/init.d/anytun index 752eb8d..9fc4d4a 100755 --- a/etc/init.d/anytun +++ b/etc/init.d/anytun @@ -55,12 +55,13 @@ start_configd () { test -d $VARCONFIG_DIR || mkdir -p $VARCONFIG_DIR chmod 700 $VARCONFIG_DIR rm -f $VARCONFIG_DIR/$NAME 2>/dev/null + KDPRF=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'kd-prf' | sed 's/^/ --/' | xargs echo` for CLIENTNAME in `ls $CONFIG_DIR/$NAME/conf.d`; do echo -n " ($CLIENTNAME)" DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/conf.d/$CLIENTNAME | grep -e '\w' | sed 's/^/ --/' | xargs echo` - $ANYTUNCONFIG $DAEMONARG >> $VARCONFIG_DIR/$NAME + $ANYTUNCONFIG $DAEMONARG $CIPHER $AUTHALGO $KDPRF >> $VARCONFIG_DIR/$NAME done - CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/'` + CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/' | xargs echo` $CONTROLDAEMON -f $VARCONFIG_DIR/$NAME $DAEMONOPTS $CONTROLHOST \ --write-pid $VARCONFIG_DIR/$NAME.pid # rm -f $VARCONFIG_DIR/$NAME @@ -68,7 +69,7 @@ start_configd () { } stop_configd () { if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then - echo -n " ($NAME)" + echo -n " ($NAME-controlld)" kill `cat $VARCONFIG_DIR/$NAME.pid` || true rm $VARCONFIG_DIR/$NAME.pid fi @@ -102,7 +103,7 @@ case "$1" in echo -n "Stoping $DESC:" if test -z "$2" ; then for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" stop_vpn @@ -112,7 +113,7 @@ case "$1" in [ -z "$1" ] && break if test -e $VARRUN_DIR/$1.pid ; then PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null` - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" stop_vpn @@ -127,7 +128,7 @@ case "$1" in echo -n "Reloading $DESC:" if test -z "$2" ; then for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then @@ -143,7 +144,7 @@ case "$1" in [ -z "$1" ] && break if test -e $VARRUN_DIR/$1.pid ; then PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null` - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then @@ -164,7 +165,7 @@ case "$1" in echo -n "Restarting $DESC:" if test -z "$2" ; then for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" stop_vpn @@ -176,7 +177,7 @@ case "$1" in [ -z "$1" ] && break if test -e $VARRUN_DIR/$1.pid ; then PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null` - NAME=`echo $PIDFILE | cut -c17-` + NAME=`basename $PIDFILE` NAME=${NAME%%.pid} echo -n " $NAME" stop_vpn |