diff options
author | Christian Pointner <equinox@anytun.org> | 2010-01-24 16:42:43 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2010-01-24 16:42:43 +0000 |
commit | 68c499cc64d568837ad6df3f49397fbb0169e88a (patch) | |
tree | 4feee963560e0df5b476d5cfbe59723e8355093f /etc/init.d | |
parent | updated Readme (diff) |
cleaned up initscript
Diffstat (limited to 'etc/init.d')
-rwxr-xr-x | etc/init.d/uanytun | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/etc/init.d/uanytun b/etc/init.d/uanytun index 75cb8cd..f540975 100755 --- a/etc/init.d/uanytun +++ b/etc/init.d/uanytun @@ -72,8 +72,7 @@ case "$1" in echo -n "Stoping $DESC:" if test -z "$2" ; then for PIDFILE in `ls $VARRUN_DIR/$NAME.*.pid 2> /dev/null`; do - VPNNAME=`echo $PIDFILE | cut -c18-` - VPNNAME=${VPNNAME%%.pid} + VPNNAME=`basename $PIDFILE .pid` echo -n " $VPNNAME" stop_vpn done @@ -82,8 +81,7 @@ case "$1" in [ -z "$1" ] && break if test -e $VARRUN_DIR/$NAME.$1.pid ; then PIDFILE=`ls $VARRUN_DIR/$NAME.$1.pid 2> /dev/null` - VPNNAME=`echo $PIDFILE | cut -c18-` - VPNNAME=${VPNNAME%%.pid} + VPNNAME=`basename $PIDFILE .pid` echo -n " $VPNNAME" stop_vpn else @@ -97,8 +95,7 @@ case "$1" in echo -n "Reloading $DESC:" if test -z "$2" ; then for PIDFILE in `ls $VARRUN_DIR/$NAME.*.pid 2> /dev/null`; do - VPNNAME=`echo $PIDFILE | cut -c18-` - VPNNAME=${VPNNAME%%.pid} + VPNNAME=`basename $PIDFILE .pid` echo -n " $VPNNAME" stop_vpn start_vpn @@ -108,8 +105,7 @@ case "$1" in [ -z "$1" ] && break if test -e $VARRUN_DIR/$NAME.$1.pid ; then PIDFILE=`ls $VARRUN_DIR/$NAME.$1.pid 2> /dev/null` - VPNNAME=`echo $PIDFILE | cut -c18-` - VPNNAME=${VPNNAME%%.pid} + VPNNAME=`basename $PIDFILE .pid` echo -n " $VPNNAME" stop_vpn start_vpn |