summaryrefslogtreecommitdiff
path: root/gentoo-linux
diff options
context:
space:
mode:
authorBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:28:02 +0000
committerBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:28:02 +0000
commit8cf42d019c32ba2113f6128bbc6add0e90b4305c (patch)
treeca70d096da24c4baaf739f203447d850110b5c11 /gentoo-linux
parentconfig file handling (diff)
working initscript
Diffstat (limited to 'gentoo-linux')
-rw-r--r--gentoo-linux/net-misc/anytun/Manifest2
-rwxr-xr-xgentoo-linux/net-misc/anytun/files/anytun-0.3.1.init35
2 files changed, 16 insertions, 21 deletions
diff --git a/gentoo-linux/net-misc/anytun/Manifest b/gentoo-linux/net-misc/anytun/Manifest
index 252e455..885d0fa 100644
--- a/gentoo-linux/net-misc/anytun/Manifest
+++ b/gentoo-linux/net-misc/anytun/Manifest
@@ -1,5 +1,5 @@
AUX anytun-0.3.1-boost-mt.patch 880 RMD160 ef4b35b7c2d976de3e970c6b5f9937e771654a21 SHA1 e03371a06741eee48e14bb3af3c5347fb0d19999 SHA256 27fed2ddf30da748ca96676c47e54c24172a67c2789b3bde7769919b76e86a58
-AUX anytun-0.3.1.init 4790 RMD160 cbf8157bceca641c600067e824d742b642bedd9e SHA1 bca46549390acc1bfb248144b95b5a4b63e06165 SHA256 9aa762ad1b375f50460560fe4597049d1808b97fe539c8dcaa4dea1634b13c9d
+AUX anytun-0.3.1.init 4741 RMD160 41021c9336fe037b4b7b76bafbe0cbc343366570 SHA1 a5b9803db65a8e2ccb881818e6d7bda0401bd475 SHA256 946a48cfae01976469f33aba4d3b281d6ae1cd1dc69f1f57d227c85a2e2e3e44
DIST anytun-0.3.1.tar.gz 133451 RMD160 0750f681887dcfc527fbf92f525e16b8ab5bfa47 SHA1 7489ebff5b5cefe909e7f187feae783b874ab614 SHA256 e696b2b6767753234df21dbfce8d994d4a9bbb75e9f3f360081d25ece5eb80c6
EBUILD anytun-0.3.1.ebuild 3147 RMD160 99d630c5371f7a82df258e8b37e0566aae7f298c SHA1 5b8e35c99ba0960ae96d55895656b18716dd7a63 SHA256 a2c42223a07373020dff307abb8700e2ed8049ec5f1682eee2f65b6b616e220a
MISC Changelog 483 RMD160 1341ab375ee45382aa223f9a5c8e59507c499d9b SHA1 8fd4ec5559e8854c5dda0cc741cc6c687da2f88f SHA256 03b0705950884ca162b27041e4d5ed168fb30a43d62c3714e9ea006c9fcb398f
diff --git a/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init
index 36822e2..113e8e1 100755
--- a/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init
+++ b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init
@@ -18,6 +18,7 @@ VARCONFIG_DIR=/var/run/anytun-controld
VARRUN_DIR=/var/run/anytun
VPN=${SVCNAME#*.}
+[ "$VPN" = "$SVCNAME" ] && VPN=""
# Include anytun defaults if available
if [ -f /etc/default/anytun ] ; then
@@ -41,10 +42,11 @@ start_vpn () {
$DAEMON --write-pid $VARRUN_DIR/$NAME.pid $POSTUP \
$DAEMONOPTS $DAEMONARG || STATUS="FAILED"
else
- STATUS="no config found"
+ eerror "no config found"
+ return 1
fi
start_configd
- echo -n "($STATUS)"
+ return 0
}
stop_vpn () {
kill `cat $PIDFILE` || true
@@ -58,7 +60,6 @@ start_configd () {
chmod 700 $VARCONFIG_DIR
rm -f $VARCONFIG_DIR/$NAME 2>/dev/null
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
done
@@ -70,19 +71,12 @@ start_configd () {
}
stop_configd () {
if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
- echo -n " ($NAME)"
kill `cat $VARCONFIG_DIR/$NAME.pid` || true
rm $VARCONFIG_DIR/$NAME.pid
fi
}
-
-
-start() {
- ebegin "Starting ${SVCNAME}"
- start_vpn
- eend $?
-
+start () {
if test -z "$VPN" ; then
if [ -f $CONFIG_DIR/autostart ] ; then
for NAME in `sed 's/#.*//' < $CONFIG_DIR/autostart | grep -e '\w'`; do
@@ -102,7 +96,7 @@ start() {
fi
}
-stop() {
+stop () {
if test -z "$VPN" ; then
for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
NAME=`echo $PIDFILE | cut -c17-`
@@ -112,8 +106,8 @@ stop() {
eend $?
done
else
- if test -e $VARRUN_DIR/$VPN.pid ; then
- PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ if test -e $VARRUN_DIR/${VPN}.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/${VPN}.pid 2> /dev/null`
NAME=`echo $PIDFILE | cut -c17-`
NAME=${NAME%%.pid}
ebegin "Stopping ${DESC} VPN: ${NAME}"
@@ -125,7 +119,7 @@ stop() {
fi
}
-reload() {
+reload () {
if test -z "$VPN" ; then
for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
NAME=`echo $PIDFILE | cut -c17-`
@@ -143,8 +137,8 @@ reload() {
fi
done
else
- if test -e $VARRUN_DIR/$VPN.pid ; then
- PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ if test -e $VARRUN_DIR/${VPN}.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/${VPN}.pid 2> /dev/null`
NAME=`echo $PIDFILE | cut -c17-`
NAME=${NAME%%.pid}
if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
@@ -164,7 +158,7 @@ reload() {
fi
}
-restart {
+restart () {
if test -z "$VPN" ; then
for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
NAME=`echo $PIDFILE | cut -c17-`
@@ -175,8 +169,8 @@ restart {
eend $?
done
else
- if test -e $VARRUN_DIR/$VPN.pid ; then
- PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ if test -e $VARRUN_DIR/${VPN}.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/${VPN}.pid 2> /dev/null`
NAME=`echo $PIDFILE | cut -c17-`
NAME=${NAME%%.pid}
ebegin "Restarting ${DESC} VPN: ${NAME}"
@@ -188,3 +182,4 @@ restart {
fi
fi
}
+