Add widget config from community profile to meshwizard
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_widgets.sh
1 #!/bin/sh
2 . /lib/functions.sh
3 . $dir/functions.sh
4
5 if [ -n "$widgets" ]; then
6 [ ! -f "/etc/config/freifunk-widgets" ] && touch /etc/config/freifunk-widgets
7 for w in $widgets; do
8 uci set freifunk-widgets.${w}=widget
9 set_defaults "${w}_" freifunk-widgets.${w}
10 uci delete profile_$community.${w}
11 done
12 uci commit profile_$community
13 uci_commitverbose "Added widget config." freifunk-widgets
14 fi