diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2017-02-23 08:31:06 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-02-24 04:16:46 +0700 |
commit | 9739c5ce58cd369a06811997dfa79861edb51adb (patch) | |
tree | 1c223420f153f039a933d90a8205f5834efd9dcc /network/verm/rc.verm | |
parent | 11fa421e7845c9cfea5571edc135bad2b3e1ddfe (diff) |
network/verm: Added (An immutable, WORM filestore).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/verm/rc.verm')
-rw-r--r-- | network/verm/rc.verm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/network/verm/rc.verm b/network/verm/rc.verm new file mode 100644 index 0000000000000..ca4895df18e88 --- /dev/null +++ b/network/verm/rc.verm @@ -0,0 +1,42 @@ +#!/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 |