summaryrefslogtreecommitdiff
path: root/control
diff options
context:
space:
mode:
Diffstat (limited to 'control')
-rwxr-xr-xcontrol88
1 files changed, 44 insertions, 44 deletions
diff --git a/control b/control
index 11c1a7e..7589d15 100755
--- a/control
+++ b/control
@@ -1,74 +1,74 @@
-#!/usr/bin/env bash
-# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org)
+#!/usr/bin/env bash
+# PerlDaemon (c) 2010, 2011, 2015 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
+ if [ -f $path/PerlDaemon/PerlDaemon.pl ]; then
+ LIBDIR=$path
+ break
+ fi
done
if [ -z "$LIBDIR" ]; then
- echo No PerlDaemon module path found
- exit 1
+ 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 $@
+ 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
+ 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)
+ echo Triggering a logrotate
+ kill -HUP $(cat ./run/perldaemon.pid)
}
keys () {
- perl -I$LIBDIR $LIBDIR/PerlDaemon/PerlDaemon.pl config=./conf/perldaemon.conf keys=1 $@
+ perl -I$LIBDIR $LIBDIR/PerlDaemon/PerlDaemon.pl config=./conf/perldaemon.conf keys=1 $@
}
case $ARG in
- start)
- shift
- start $@
- ;;
+ start)
+ shift
+ start $@
+ ;;
- stop)
- stop
- ;;
+ stop)
+ stop
+ ;;
- restart)
- shift
- stop
- start $@
- ;;
+ restart)
+ shift
+ stop
+ start $@
+ ;;
- logrotate)
- logrotate
- ;;
+ logrotate)
+ logrotate
+ ;;
- foreground)
- start daemon.daemonize=no $@
- ;;
+ foreground)
+ start daemon.daemonize=no $@
+ ;;
- keys)
- keys $@
- ;;
+ keys)
+ keys $@
+ ;;
- *)
- echo "Usage: $0 <start|stop|restart|logrotate|foreground|keys> [key1=val1 [[key2=val2] ...]]"
- exit 1
- ;;
+ *)
+ echo "Usage: $0 <start|stop|restart|logrotate|foreground|keys> [key1=val1 [[key2=val2] ...]]"
+ exit 1
+ ;;
esac