mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
3af05a73db
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
41 lines
557 B
Bash
41 lines
557 B
Bash
#!/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
|