diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/sancp/files/sancp.rc1 |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/sancp/files/sancp.rc1')
-rw-r--r-- | net-analyzer/sancp/files/sancp.rc1 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/net-analyzer/sancp/files/sancp.rc1 b/net-analyzer/sancp/files/sancp.rc1 new file mode 100644 index 000000000000..07745f675676 --- /dev/null +++ b/net-analyzer/sancp/files/sancp.rc1 @@ -0,0 +1,42 @@ +#!/sbin/openrc-run +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +today=$(date '+%Y-%m-%d') + +depend() { + need net +} +checkconfig() { + if [ ! -e /etc/sancp/sancp.conf ] ; then + eerror "You need an /etc/sancp/sancp.conf to run sancp" + return 1 + fi +} + +start() { + checkconfig || return 1 + + # Today's log directory + if [ ! -d $LOGDIR/$today ]; then + /bin/mkdir $LOGDIR/$today + /bin/rm -f $LOGDIR/today + fi + + # today/ directory :) + if [ ! -d $LOGDIR/today ]; then + /bin/ln -s $LOGDIR/$today $LOGDIR/today + fi + + ebegin "Starting sancp" + start-stop-daemon --start --quiet -m --pidfile /var/run/sancp.pid \ + --exec /usr/bin/sancp \ + -- ${SANCP_OPTS} > /var/log/sancp.log 2>&1 & + eend $? +} + +stop() { + ebegin "Stopping sancp" + start-stop-daemon --stop --quiet --pidfile /var/run/sancp.pid + eend $? +} |