summaryrefslogtreecommitdiff
path: root/network/ptokax/rc.ptokax
diff options
context:
space:
mode:
authormara <mara@fail.pp.ua>2014-03-09 23:31:08 +0700
committerErik Hanson <erik@slackbuilds.org>2014-03-12 12:42:49 -0500
commit3af05a73db97e5fc081f91f9aba96cb589d69236 (patch)
tree7953060547c996a4e9853f6ea67d14fedc2591a1 /network/ptokax/rc.ptokax
parentd8f613f9da5217299548a392e12f81d7ff02d0dd (diff)
downloadslackbuilds-3af05a73db97e5fc081f91f9aba96cb589d69236.tar.gz
network/ptokax: Added (Direct Connect Peer-To-Peer sharing network).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/ptokax/rc.ptokax')
-rw-r--r--network/ptokax/rc.ptokax41
1 files changed, 41 insertions, 0 deletions
diff --git a/network/ptokax/rc.ptokax b/network/ptokax/rc.ptokax
new file mode 100644
index 0000000000..8fd308095b
--- /dev/null
+++ b/network/ptokax/rc.ptokax
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+NAME=ptokax
+PREFIX=/usr
+DAEMON=$PREFIX/bin/${NAME}
+CONFIG=/etc/${NAME}/
+
+start() {
+ pid=$(pidof -o %PPID $NAME)
+ if [[ -z $pid ]]; then
+ echo "Start services: $NAME"
+ $DAEMON -d -c $CONFIG 2>&1 >> /dev/null
+ else
+ echo "Services $NAME already running."
+ fi
+}
+
+stop() {
+ echo "Stop services: $NAME."
+ killall -9 $NAME 2> /dev/null
+}
+
+restart() {
+ stop
+ sleep 2
+ start
+}
+
+case $1 in
+'start')
+ start
+ ;;
+'stop')
+ stop
+ ;;
+'restart')
+ restart
+ ;;
+*)
+ echo "Usage $0 {start|stop|restart}"
+esac