Add config and init files for iodined
authorFlorian Fainelli <florian@openwrt.org>
Sun, 16 Sep 2007 09:53:42 +0000 (09:53 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 16 Sep 2007 09:53:42 +0000 (09:53 +0000)
SVN-Revision: 8784

net/iodine/Makefile
net/iodine/files/iodined.config [new file with mode: 0644]
net/iodine/files/iodined.init [new file with mode: 0644]

index e37c8a6e0991d929439f2d91da651f1a333e3c25..5eb854e385435792c6aef1be47959d6f53ebd713 100644 (file)
@@ -61,6 +61,10 @@ define Package/iodine/install
 endef
 
 define Package/iodined/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/iodined.init $(1)/etc/init.d/iodined
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/iodined.config $(1)/etc/config/iodined
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/iodined $(1)/usr/sbin
 endef
diff --git a/net/iodine/files/iodined.config b/net/iodine/files/iodined.config
new file mode 100644 (file)
index 0000000..f95549d
--- /dev/null
@@ -0,0 +1,5 @@
+config iodined
+        option address     ''
+        option password    ''
+        option tunnelip    '10.0.0.1'
+        option tld                ''
diff --git a/net/iodine/files/iodined.init b/net/iodine/files/iodined.init
new file mode 100644 (file)
index 0000000..1eac807
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=50
+
+start_service () {
+       local section="$1"
+       config_get address  "$section" address
+       config_get password "$section" password
+       config_get tunnelip "$section" tunnelip
+       config_get tld      "$section" tld
+       
+       iodined -l $address -P $password $tunnelip $tld
+}
+
+start() {
+       config_load "iodined"
+       config_foreach start_service iodined
+}
+
+stop() {
+       killall iodined
+}