contrib/meshwizard: Cleanup and add ssid_scheme option
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / functions.sh
index 5e0e1941854053e11a491c15647baa1be5c60cbc..689289bbb8e7321d06f2ab57a03af653d140e9ce 100644 (file)
@@ -12,11 +12,21 @@ uci_remove_list_element() {
        done
 }
 
+# Takes 2 arguments
+# $1 = text to be displayed in the output for this section
+# $2 = section (optional)
+uci_commitverbose() {
+       echo "+ $1"
+       uci changes $2 | while read line; do
+               echo "    $line"
+       done
+       uci commit $2
+}
+
 set_defaults() {
        for def in $(env |grep "^$1"); do
                option=${def/$1/}
                uci set $2.$option
-               echo "    ${option/=/: }"
        done
 }
 
@@ -30,10 +40,6 @@ section_rename() {
        uci -q rename $1.$2=$3 && msg_rename $1.$2 $1.$3 || msg_rename_error $1.2 $1.$3
 }
 
-msg_start() {
-       echo "  Starting configuration of $1"
-}
-
 msg_cleanup() {
        echo "    Cleanup: Removed section $1."
 }