diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-08-14 13:03:12 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-11-02 11:49:52 +0100 |
commit | a4d0a12fd09707ed44d5fcf5349216a6a73403de (patch) | |
tree | db36afa7e0db8141fb1dfc76081f1790e1867c5c /tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating | |
parent | 44a2eae47455fe18216ead8299f027050da11408 (diff) |
Add network test server Vagrant config and Puppet scripts
Change-Id: I5385306f2e8ae44c4b10251ca7ee1914b9fc7bbe
Diffstat (limited to 'tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating')
-rwxr-xr-x | tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating b/tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating new file mode 100755 index 0000000000..9f9084c337 --- /dev/null +++ b/tests/auto/network/support/modules/network_test_server/files/init/danted-authenticating @@ -0,0 +1,70 @@ +#! /bin/sh +# +# dante SOCKS server init.d file. Based on /etc/init.d/skeleton: +# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/danted +NAME=$(basename $0) # may be `danted', `danted-authenticating', etc. Note: In boot it's 'S20danted-authenticating' etc. +DESC="Dante SOCKS daemon" +PIDFILE=/var/run/qt_danted-authenticating.pid +CONFFILE=/etc/danted-authenticating.conf + +test -f $DAEMON || exit 0 +test -f $CONFFILE || { echo "error: $CONFFILE does not exist" 1>&2; exit 2; } + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --startas $DAEMON --make-pidfile --background \ + -- -f $CONFFILE + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE + echo "$NAME." + ;; + reload|force-reload) + echo "Reloading $DESC configuration files." + start-stop-daemon --stop --signal 1 --quiet --pidfile \ + $PIDFILE + ;; + restart) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE || : + sleep 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --startas $DAEMON --make-pidfile --background \ + -- -f $CONFFILE + echo "$NAME." + ;; + + status) + echo -n "Showing status of $DESC: " + if [ -f $PIDFILE ]; then + PID=`cat $PIDFILE` + if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then + printf "%s\n" "Process dead but pidfile exists" + exit 1 + else + echo "Running" + exit 0 + fi + else + printf "%s\n" "Service not running" + exit 1 + fi + ;; + *) + N=/etc/init.d/danted-authenticating + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 |