summaryrefslogtreecommitdiff
path: root/network/windscribe/rc.windscribe
diff options
context:
space:
mode:
Diffstat (limited to 'network/windscribe/rc.windscribe')
-rw-r--r--network/windscribe/rc.windscribe79
1 files changed, 79 insertions, 0 deletions
diff --git a/network/windscribe/rc.windscribe b/network/windscribe/rc.windscribe
new file mode 100644
index 0000000000..8341cd89c1
--- /dev/null
+++ b/network/windscribe/rc.windscribe
@@ -0,0 +1,79 @@
+#!/usr/bin/env bash
+
+
+
+PRGNAM=windscribe
+PID=/var/run/$PRGNAM.pid
+DAEMON=/usr/bin/windscribe
+
+
+#
+# Function that starts the daemon
+#
+windscribe_start()
+{
+ if [ -s $PID ]; then
+ echo "$PRGNAM is already running: $(cat $PID)"
+ exit 1
+ fi
+
+ if [ -x $DAEMON ]; then
+ $DAEMON start
+ pidof $DAEMON > $PID
+ fi
+}
+
+#
+# Function that stops the daemon
+#
+windscribe_stop()
+{
+ if [ -s $PID ]; then
+ $DAEMON stop
+ rm -rf $PID
+ else
+ echo "$PRGNAM is not running."
+ fi
+}
+
+#
+# Function that restarts the daemon
+#
+windscribe_restart()
+{
+ windscribe_stop
+ sleep 1
+ windscribe_start
+}
+
+#
+# Function that shows the current status of the daemon
+#
+windscribe_status()
+{
+ if [ -s $PID ]; then
+ echo "$PRGNAM is running: $(cat $PID)"
+ else
+ echo "$PRGNAM is not running."
+ fi
+}
+
+
+case "$1" in
+ start)
+ windscribe_start
+ ;;
+ stop)
+ windscribe_stop
+ ;;
+ restart)
+ windscribe_restart
+ ;;
+ status)
+ windscribe_status
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac