File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments