Add enabled option to multiwan
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Mar 2012 11:47:48 +0000 (11:47 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Mar 2012 11:47:48 +0000 (11:47 +0000)
Hi

Attached modified patchs for multiwan and luci-app-multiwan

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
Le 19/12/2011 18:30, Etienne Champetier a écrit :
> Hi
>
> Here follows the patch for luci multiwan package
> I've also opened a ticket on the luci trac
>
> Regards
>
> Le 19/12/2011 16:38, Etienne Champetier a écrit :
>> Hi
>>
>> The only mean to disable multiwan is to delete the symlink in /etc/rc.d, but if you make a backup and restore it you have to re-delete the symlink.
>>
>> This small patch add an "enabled" option to multiwan script.
>>
>> It will allow me to have one image per router model, not one with multiwan and one without.
>>
>> Best regards
>>
>> Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
>>
>>
>>
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

SVN-Revision: 30832

net/multiwan/Makefile
net/multiwan/files/etc/config/multiwan
net/multiwan/files/usr/bin/multiwan

index f84fcf6d029365b3888cfd813df96200965914a0..76c61d83b58a407bb31e3498759a1a3bdfe082ee 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=multiwan
-PKG_VERSION:=1.0.19
+PKG_VERSION:=1.0.20
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -39,4 +39,9 @@ define Package/multiwan/install
        $(CP) ./files/* $(1)
 endef
 
+define Package/multiwan/postinst
+[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/multiwan enable
+exit 0
+endef
+
 $(eval $(call BuildPackage,multiwan))
index b89096e765209da7a88787d1bfa903ec72dc3b61..c88bdf3c1c584e8b96cbca4eb275801b65483323 100644 (file)
@@ -1,5 +1,8 @@
 
 config 'multiwan' 'config'
+       # REMOVE THIS LINE OR PUT TO 1 TO ENABLE MULTIWAN
+       option 'enabled' '0'
+
        option 'default_route' 'balancer'
        # health_monitor below is defaulted to parallel, and can be set to
        # serial to save system resources.
index fb6e8b1c678d72a324c5573ab39ef9e601054e2d..c2fb3ab26e64f57382de7c0bb3a4931a4ed6fa0f 100755 (executable)
@@ -1011,6 +1011,8 @@ max_interval=$(((1<<31) - 1))
 
 config_clear
 config_load "multiwan"
+config_get_bool        enabled config  enabled '1'
+[ "$enabled" -gt 0 ] || exit
 config_get default_route       config default_route
 config_get health_monitor      config health_monitor
 config_get iptables_interval   config iptables_interval '30'