summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Tittelbach (xro) <xro@gmx.net>2009-11-20 18:17:38 +0000
committerBernhard Tittelbach (xro) <xro@gmx.net>2009-11-20 18:17:38 +0000
commit0a9d461244fd50e0b52146ccb62abb02860f873b (patch)
tree39bd00926923a0557f52c54f6983b7ae75ff34dc /net-misc/anytun
parentAutomatic update to use.local.desc (diff)
downloadsunrise-reviewed-0a9d461244fd50e0b52146ccb62abb02860f873b.tar.gz
sunrise-reviewed-0a9d461244fd50e0b52146ccb62abb02860f873b.tar.bz2
sunrise-reviewed-0a9d461244fd50e0b52146ccb62abb02860f873b.zip
net-misc/anytun: now using start-stop-daemon in init script
svn path=/sunrise/; revision=9563
Diffstat (limited to 'net-misc/anytun')
-rw-r--r--net-misc/anytun/ChangeLog4
-rw-r--r--net-misc/anytun/Manifest4
-rwxr-xr-xnet-misc/anytun/files/anytun-0.3.1.init18
3 files changed, 14 insertions, 12 deletions
diff --git a/net-misc/anytun/ChangeLog b/net-misc/anytun/ChangeLog
index 5569d1b9e..7bf81f10c 100644
--- a/net-misc/anytun/ChangeLog
+++ b/net-misc/anytun/ChangeLog
@@ -2,6 +2,10 @@
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v3
# $Header: $
+ 20 Nov 2009; Bernhard Tittelbach (xro) <xro@gmx.net>
+ files/anytun-0.3.1.init:
+ now using start-stop-daemon in init script
+
19 Nov 2009; Bernhard Tittelbach (xro) <xro@gmx.net>
files/anytun-0.3.1.init:
removed custom restart() from init script
diff --git a/net-misc/anytun/Manifest b/net-misc/anytun/Manifest
index 751d8dfc1..895a2d17b 100644
--- a/net-misc/anytun/Manifest
+++ b/net-misc/anytun/Manifest
@@ -1,5 +1,5 @@
-AUX anytun-0.3.1.init 4155 RMD160 9846efb22439e73039a39b5d90156207187eb910 SHA1 080d9d3e01641b06f37051860fa24405cce0ea2e SHA256 1e3399995a2fa61ae7476e1370590f8e21ac79e566f53cca8030d3f64ded21ba
+AUX anytun-0.3.1.init 4347 RMD160 35d91ef382308ad59c3183da979a19dd4aa93b42 SHA1 34ba3ac7f2f037203254b67976d5f43aa350e50a SHA256 1e4860ef912ee4fab3bc46d035fa2065edcd075bb752b902dc3d8f16b48603dc
DIST anytun-0.3.1.tar.gz 133451 RMD160 0750f681887dcfc527fbf92f525e16b8ab5bfa47 SHA1 7489ebff5b5cefe909e7f187feae783b874ab614 SHA256 e696b2b6767753234df21dbfce8d994d4a9bbb75e9f3f360081d25ece5eb80c6
EBUILD anytun-0.3.1.ebuild 2973 RMD160 357415b3781b6177927cb57ba5111bc5b6a11b56 SHA1 600fbcdc2037a31f3be022a365b87b2e7e0297fc SHA256 74b0f0db27c154daf75cf7f99d8388120e37821ef14a72f152a73888c3cfd451
-MISC ChangeLog 645 RMD160 a2d3e543d9357f274e80cb63af7a9a2936e3ab50 SHA1 f4b842f33a3dadc18851de198740c43dd348ac5d SHA256 71999b6226bcc577a8506b414719961df4776fd5b8304d3ebad7689dcdd5df58
+MISC ChangeLog 773 RMD160 e1f5b6dc5c542c3f1bd22ffdaa884b1e576f92ff SHA1 eca6347c08c547a635fc71ddad7033fbba2b1aa3 SHA256 b82c14d0b8eaa2ed7ed21db0619da11953208406990dd08c08f49c8d1d15b38e
MISC metadata.xml 676 RMD160 076aacf8fa6c9063e3e6cff368e8f5c45980ede3 SHA1 0a0af1b5f03b28a698c8cd3f22e62cdfa7418481 SHA256 2f185c8e9c5cbcf72c2e344d17923dfb4745a87d28860e45824d67412afc4e1b
diff --git a/net-misc/anytun/files/anytun-0.3.1.init b/net-misc/anytun/files/anytun-0.3.1.init
index 681602cf7..1818bfa69 100755
--- a/net-misc/anytun/files/anytun-0.3.1.init
+++ b/net-misc/anytun/files/anytun-0.3.1.init
@@ -30,7 +30,6 @@ test -x $DAEMON || exit 1
start_vpn () {
- STATUS="OK"
if [ -f $CONFIG_DIR/$NAME/config ] ; then
POSTUP=''
test -f $CONFIG_DIR/$NAME/post-up.sh && POSTUP="-x $CONFIG_DIR/$NAME/post-up.sh"
@@ -40,8 +39,8 @@ start_vpn () {
fi
test -d $VARRUN_DIR || mkdir -p $VARRUN_DIR
DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed 's/^/--/' | tr '\n' ' '`
- $DAEMON --write-pid $VARRUN_DIR/$NAME.pid $POSTUP \
- $DAEMONOPTS $DAEMONARG || STATUS="FAILED"
+ start-stop-daemon --start --pidfile $VARRUN_DIR/${NAME}.pid --exec $DAEMON -- --write-pid $VARRUN_DIR/${NAME}.pid $POSTUP \
+ $DAEMONOPTS $DAEMONARG || return 1
else
eerror "no config found"
return 1
@@ -50,8 +49,8 @@ start_vpn () {
return 0
}
stop_vpn () {
- kill `cat $PIDFILE` || true
- rm $PIDFILE
+ start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --oknodo
+ rm -f $PIDFILE
stop_configd
}
@@ -65,15 +64,14 @@ start_configd () {
$ANYTUNCONFIG $DAEMONARG >> $VARCONFIG_DIR/$NAME
done
CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/'`
- $CONTROLDAEMON -f $VARCONFIG_DIR/$NAME $DAEMONOPTS $CONTROLHOST \
- --write-pid $VARCONFIG_DIR/$NAME.pid
- # rm -f $VARCONFIG_DIR/$NAME
+ start-stop-daemon --start --pidfile $VARCONFIG_DIR/${NAME}.pid --exec $CONTROLDAEMON \
+ -- -f $VARCONFIG_DIR/$NAME $DAEMONOPTS $CONTROLHOST --write-pid $VARCONFIG_DIR/${NAME}.pid
fi
}
stop_configd () {
if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
- kill `cat $VARCONFIG_DIR/$NAME.pid` || true
- rm $VARCONFIG_DIR/$NAME.pid
+ start-stop-daemon --stop --pidfile $VARCONFIG_DIR/${NAME}.pid --exec $CONTROLDAEMON --oknodo
+ rm -f $VARCONFIG_DIR/${NAME}.pid
fi
}