mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-06 08:26:50 +01:00
9739c5ce58
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
42 lines
708 B
Bash
42 lines
708 B
Bash
#!/bin/bash
|
|
|
|
PORT=${PORT:-3404}
|
|
LISTEN=${LISTEN:-localhost}
|
|
PIDDIR=/var/run/verm
|
|
LOGDIR=/var/log/verm
|
|
PIDFILE=$PIDDIR/verm.pid
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
runuser() {
|
|
su "$@"
|
|
}
|
|
|
|
verm_start() {
|
|
mkdir -p $PIDDIR $LOGDIR
|
|
chown -R verm:verm $PIDDIR $LOGDIR
|
|
action "Starting verm: " daemon --pidfile $PIDFILE --user verm "bash -c 'verm -port \"$PORT\" -listen \"$LISTEN\" >> $LOGDIR/verm.log 2>> $LOGDIR/verm_err.log & echo \$! > $PIDFILE'"
|
|
}
|
|
|
|
verm_stop() {
|
|
action "Stopping verm: " killproc -p $PIDFILE "verm"
|
|
}
|
|
|
|
verm_restart() {
|
|
verm_stop
|
|
verm_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
verm_start
|
|
;;
|
|
'stop')
|
|
verm_stop
|
|
;;
|
|
'restart')
|
|
verm_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|