contrib/meshwizard: add helpers/restore_default_config.sh
authorManuel Munz <freifunk@somakoma.de>
Thu, 6 Oct 2011 19:39:58 +0000 (19:39 +0000)
committerManuel Munz <freifunk@somakoma.de>
Thu, 6 Oct 2011 19:39:58 +0000 (19:39 +0000)
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh [new file with mode: 0755]

diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh
new file mode 100755 (executable)
index 0000000..3f6ce35
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+# This will restore default "factory" settings before running the meshwizard
+# and is used when cleanup=1
+# Warning: This will reset network settings for wan and lan to defaults too.
+
+echo "+ Restore default config as requested with cleanup=1"
+cp -f /rom/etc/config/* /etc/config/
+rm /etc/config/wireless
+wifi detect > /etc/config/wireless
+rm /etc/config/network
+/etc/init.d/defconfig start