summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts/template-restart-slapd.in
blob: 6f5c0c893dbc5d921b3634585b7df6dbc6fff43b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

# Script that restarts the ns-slapd server.
# Exit status can be:
#       0: Server restarted successfully
#       1: Server could not be started
#       2: Server started successfully (was not running)
#       3: Server could not be stopped

server_already_stopped=0
{{INST-DIR}}/stop-slapd
status=$?
if [ $status -eq 1 ] ; then
    exit 3;
else
   if [ $status -eq 2 ] ; then
        server_already_stopped=1
   fi
fi
{{INST-DIR}}/start-slapd
status=$?
if [ $server_already_stopped -eq 1 ] && [ $status -eq 0 ] ; then
    exit 2;
fi
exit $status