forked from daknob/mwhois
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mwhois-init-example
56 lines (51 loc) · 869 Bytes
/
mwhois-init-example
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# init file for mwhois
#
# chkconfig: - 50 50
# description: mwhois Daemon
#
RETVAL=0
prog="mwhois"
start() {
echo -n $"Starting $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
cd /opt/mwhois; ./mwhoisd &
RETVAL=$?
fi;
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
pkill -9 mwhoisd
RETVAL=$?
fi;
echo
return $RETVAL
}
restart(){
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL