-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2008 OpenWrt.org
-BIN=portmap
-DEFAULT=/etc/default/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
+START=40
+NAME=portmap
+PROG=/usr/sbin/$NAME
+DEFAULT=/etc/default/$NAME
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- *)
- echo "usage: $0 start"
- exit 1
-esac
+start() {
+ [ -f $DEFAULT ] && . $DEFAULT
+ start-stop-daemon -q -S -x $PROG -- $OPTIONS
+}
-exit $?
+stop() {
+ start-stop-daemon -q -K -x $PROG -- $OPTIONS
+}