blob: 713f86161f89d4d6176f9b8e0af3a24ff99b22ca (
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
26
27
28
29
30
31
32
|
#!/bin/sh
DGD_CONF=%%PREFIX%%/etc/dgd-lpmud/lpmud.dgd
DGD_USER=mud
DGD=%%PREFIX%%/sbin/dgd
DGD_HNAME=%%PREFIX%%/bin/lpmud-hname
DGD_HNAME_PORT=6047
DGD_HNAME_PASSWD=HNAMEPASS
DGD_LOG=%%DATADIR%%/lpmud/log/lpmud.log
DGD_PID=/var/run/dgd-lpmud.pid
case "$1" in
start)
if [ -x "${DGD}" ]; then
su ${DGD_USER} -c "${DGD_HNAME} ${DGD_HNAME_PORT} ${DGD_HNAME_PASSWD}" > /dev/null 2>&1 &
sleep 1
su ${DGD_USER} -c "${DGD} ${DGD_CONF}" >> "${DGD_LOG}" 2>&1 &
echo $(($!+2)) > "${DGD_PID}"
echo -n ' dgd-lpmud'
fi
;;
stop)
kill -TERM `cat "${DGD_PID}"` && rm -f "${DGD_PID}"
killall -TERM lpmud-hname
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
|