Skip to content
Snippets Groups Projects
Commit 52d5cba3 authored by Vladimir Homutov's avatar Vladimir Homutov Committed by GitHub
Browse files

Merge pull request #6 from ClassicTim/add_rh_ctl_script

Added CTL script for RedHat linux.
parents 995d0f8e 9e55fd2c
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
CMD=nginx-ldap-auth-daemon.py
if [ ! -f "$CMD" ]; then
echo "Please run '$0' from the same directory where '$CMD' file resides"
exit 1
fi
CMD=$PWD/$CMD
PIDFILE=./nginx-ldap-auth-daemon.pid
. /etc/init.d/functions
start() {
echo -n "Starting ldap-auth-daemon: "
if [ -s ${PIDFILE} ]; then
RETVAL=1
echo -n "Already running !" && warning
echo
else
nohup ${CMD} >/dev/null 2>&1 &
RETVAL=$?
PID=$!
[ $RETVAL -eq 0 ] && success || failure
echo
echo $PID > ${PIDFILE}
fi
}
case $1 in
"start")
start
;;
"stop")
echo -n "Stopping ldap-auth-daemon: "
killproc -p $PIDFILE $CMD
echo
;;
*)
echo "Usage: $0 <start|stop>"
;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment