# Defaults for anytun initscript
# sourced by /etc/init.d/anytun
-# Note: chroot is tricky and not reliable yet. Use it only
-# if you know what you're doing.
-#CHROOTDIR='/var/run/anytun'
-#DAEMONOPTS="--chroot $CHROOTDIR --username nobody"
-
# Additional options that are passed to the Daemon.
DAEMONOPTS="--username anytun"
--- /dev/null
+#!/bin/sh
+# prerm script for anytun
+
+set -e
+
+if [ -x "/etc/init.d/anytun" ] && [ "$1" = remove ]; then
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d anytun stop || true
+ else
+ /etc/init.d/anytun stop || true
+ fi
+fi
dh_installdocs
dh_installexamples
dh_installinit
- # dh_installman src/man/anytun.8
dh_link
dh_strip
dh_compress
- mkdir -p debian/anytun/usr/share/lintian/overrides/
+ mkdir -p debian/anytun/usr/share/lintian/overrides/
cp -av debian/overrides debian/anytun/usr/share/lintian/overrides/anytun
dh_fixperms
find debian/anytun -type f -name config -exec chmod 600 {} \;
find debian/anytun -type f -name post-up.sh -exec chmod 755 {} \;
+ chmod 600 debian/anytun/usr/share/anytun/examples/config/server/conf.d/*
dh_installdeb
dh_shlibdeps
dh_gencontrol
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"
+ $DAEMON --write-pid /var/run/uanytun.$NAME.pid $POSTUP $DAEMONOPTS $DAEMONARG || STATUS="FAILED"
else
STATUS="no config found"
fi