summaryrefslogtreecommitdiff
path: root/package/portmap
diff options
context:
space:
mode:
Diffstat (limited to 'package/portmap')
-rwxr-xr-xpackage/portmap/init-portmap44
-rw-r--r--package/portmap/portmap.mk4
2 files changed, 47 insertions, 1 deletions
diff --git a/package/portmap/init-portmap b/package/portmap/init-portmap
new file mode 100755
index 000000000..573a16abf
--- /dev/null
+++ b/package/portmap/init-portmap
@@ -0,0 +1,44 @@
+#! /bin/sh
+
+[ -f /sbin/portmap ] || exit 0
+
+start() {
+ echo -n "Starting portmap: "
+ portmap
+ mkdir -p /var/lock/subsys
+ touch /var/lock/subsys/portmap
+ echo "done"
+}
+
+
+stop() {
+ echo -n "Stopping portmap: "
+ echo
+ killall portmap
+ rm -rf /var/lock/subsys
+ echo "done"
+}
+
+restart() {
+ stop
+ start
+ rm -f /var/run/portmap.state
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/package/portmap/portmap.mk b/package/portmap/portmap.mk
index 001ecbb43..29fdc2927 100644
--- a/package/portmap/portmap.mk
+++ b/package/portmap/portmap.mk
@@ -25,12 +25,14 @@ $(PORTMAP_DIR)/$(PORTMAP_BINARY): $(PORTMAP_DIR)/.unpacked
$(MAKE) CC=$(TARGET_CC) O="$(TARGET_CFLAGS)" -C $(PORTMAP_DIR)
$(TARGET_DIR)/$(PORTMAP_TARGET_BINARY): $(PORTMAP_DIR)/$(PORTMAP_BINARY)
- install -D $(PORTMAP_DIR)/$(PORTMAP_BINARY) $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY)
+ $(INSTALL) -D $(PORTMAP_DIR)/$(PORTMAP_BINARY) $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY)
+ $(INSTALL) -m 0755 -D package/portmap/init-portmap $(TARGET_DIR)/etc/init.d/S13portmap
portmap: uclibc $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY)
portmap-clean:
rm -f $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY)
+ rm -f $(TARGET_DIR)/etc/init.d/S13portmap
-$(MAKE) -C $(PORTMAP_DIR) clean
portmap-dirclean: