Initial commit: Uploaded everything from abs/core
[arch-rock.git] / support / portmap / portmap
blobfb83a0a02cb13c87247c5c139602b24787edc311
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /sbin/portmap`
7 case "$1" in
8 start)
9 stat_busy "Starting Portmap"
10 [ -z "$PID" ] && /sbin/portmap
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 echo $PID > /var/run/portmap.pid
15 add_daemon portmap
16 stat_done
19 stop)
20 stat_busy "Stopping Portmap"
21 [ ! -z "$PID" ] && kill $PID &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm /var/run/portmap.pid
26 rm_daemon portmap
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0