automatically configure switches when swconfig is installed
authorFelix Fietkau <nbd@openwrt.org>
Tue, 21 Apr 2009 18:48:48 +0000 (18:48 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 21 Apr 2009 18:48:48 +0000 (18:48 +0000)
SVN-Revision: 15328

package/swconfig/Makefile
package/swconfig/files/switch.sh [new file with mode: 0644]

index e18f556505cc673d4eecdd36dcdeb2fa5cac6424..5959ef4c8c76b97c3de55fd83f3778c8bcdb00e0 100644 (file)
@@ -38,8 +38,9 @@ define Build/Compile
 endef
 
 define Package/swconfig/install
-       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_DIR) $(1)/bin $(1)/lib/network
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/bin/swconfig
+       $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
 endef
 
 $(eval $(call BuildPackage,swconfig))
diff --git a/package/swconfig/files/switch.sh b/package/swconfig/files/switch.sh
new file mode 100644 (file)
index 0000000..d752b13
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Copyright (C) 2009 OpenWrt.org
+
+setup_switch_dev() {
+       swconfig dev "$1" load network
+}
+
+setup_switch() {
+       config_load network
+       config_foreach setup_switch_dev switch
+}