From b4558f620a4e30731b01b6e0f60da869e3de5e1b Mon Sep 17 00:00:00 2001 From: "admin (centauri.fritz.box)" Date: Sat, 22 Mar 2014 12:17:10 +0100 Subject: fix git repo --- control | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) mode change 120000 => 100755 control (limited to 'control') diff --git a/control b/control deleted file mode 120000 index 187e168..0000000 --- a/control +++ /dev/null @@ -1 +0,0 @@ -bin/perldaemon \ No newline at end of file diff --git a/control b/control new file mode 100755 index 0000000..11c1a7e --- /dev/null +++ b/control @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) + +declare -r ARG=$1 +declare -a LIBPATHS=(./lib ../lib /lib /usr/lib /usr/local/lib /opt/lib) + +for path in ${LIBPATHS[@]}; do + if [ -f $path/PerlDaemon/PerlDaemon.pl ]; then + LIBDIR=$path + break + fi +done + +if [ -z "$LIBDIR" ]; then + echo No PerlDaemon module path found + exit 1 +fi + +start () { + echo Starting daemon now... + perl -I$LIBDIR $LIBDIR/PerlDaemon/PerlDaemon.pl config=./conf/perldaemon.conf $@ +} + +stop () { + if [ -f ./run/perldaemon.pid ]; then + echo Stopping daemon now... + kill $(cat ./run/perldaemon.pid); + else + echo "No pidfile found (not running?) " + fi +} + +logrotate () { + echo Triggering a logrotate + kill -HUP $(cat ./run/perldaemon.pid) +} + +keys () { + perl -I$LIBDIR $LIBDIR/PerlDaemon/PerlDaemon.pl config=./conf/perldaemon.conf keys=1 $@ +} + +case $ARG in + start) + shift + start $@ + ;; + + stop) + stop + ;; + + restart) + shift + stop + start $@ + ;; + + logrotate) + logrotate + ;; + + foreground) + start daemon.daemonize=no $@ + ;; + + keys) + keys $@ + ;; + + *) + echo "Usage: $0 [key1=val1 [[key2=val2] ...]]" + exit 1 + ;; +esac -- cgit v1.2.3