Skip to content

Commit 9e55fd2

Browse files
author
Artem Stepanov
committed
Added ctl script for RedHat linux.
1 parent 081d42d commit 9e55fd2

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

nginx-ldap-auth-daemon-ctl-rh.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
3+
CMD=nginx-ldap-auth-daemon.py
4+
if [ ! -f "$CMD" ]; then
5+
echo "Please run '$0' from the same directory where '$CMD' file resides"
6+
exit 1
7+
fi
8+
9+
CMD=$PWD/$CMD
10+
PIDFILE=./nginx-ldap-auth-daemon.pid
11+
12+
. /etc/init.d/functions
13+
14+
start() {
15+
echo -n "Starting ldap-auth-daemon: "
16+
if [ -s ${PIDFILE} ]; then
17+
RETVAL=1
18+
echo -n "Already running !" && warning
19+
echo
20+
else
21+
nohup ${CMD} >/dev/null 2>&1 &
22+
RETVAL=$?
23+
PID=$!
24+
[ $RETVAL -eq 0 ] && success || failure
25+
echo
26+
echo $PID > ${PIDFILE}
27+
fi
28+
}
29+
30+
case $1 in
31+
"start")
32+
start
33+
;;
34+
"stop")
35+
echo -n "Stopping ldap-auth-daemon: "
36+
killproc -p $PIDFILE $CMD
37+
echo
38+
;;
39+
*)
40+
echo "Usage: $0 <start|stop>"
41+
;;
42+
esac

0 commit comments

Comments
 (0)