summaryrefslogtreecommitdiff
path: root/yggdrasil/yggdrasil.rc
diff options
context:
space:
mode:
Diffstat (limited to 'yggdrasil/yggdrasil.rc')
-rwxr-xr-xyggdrasil/yggdrasil.rc43
1 files changed, 43 insertions, 0 deletions
diff --git a/yggdrasil/yggdrasil.rc b/yggdrasil/yggdrasil.rc
new file mode 100755
index 0000000..45d662d
--- /dev/null
+++ b/yggdrasil/yggdrasil.rc
@@ -0,0 +1,43 @@
1#!/bin/sh
2#
3# /etc/rc.d/yggdrasil: start/stop yggdrasil daemon
4# Shokara: modified tor's service file
5#
6
7# User settings here
8DAEMON=yggdrasil
9CONFFILE=/etc/yggdrasil.conf
10
11[ -e $CONFFILE ] || yggdrasil -genconf >$CONFFILE
12
13RETVAL=0
14
15case $1 in
16start)
17 echo -n "Starting $DAEMON..."
18 /usr/bin/$DAEMON -useconffile $CONFFILE > /dev/null & RETVAL=$?
19 if [ $RETVAL = 0 ]; then
20 echo " done."
21 fi
22 ;;
23stop)
24 echo -n "Shutting down $DAEMON..."
25 killall -q /usr/bin/$DAEMON
26 RETVAL=$?
27 echo " done."
28 ;;
29restart)
30 $0 stop
31 sleep 5
32 $0 start
33 RETVAL=$?
34 ;;
35*)
36 echo "usage: $0 [start|stop|restart]"
37 exit 1
38 ;;
39esac
40
41exit $RETVAL
42
43# End of file