Add new meshwizard (WIP)
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_splash.sh
1 #!/bin/sh
2 # Setup_splash, takes 1 argument: 1=net
3
4 . /etc/functions.sh
5 . $dir/functions.sh
6
7 net=$1
8
9 handle_splash() {
10 config_get network "$1" network
11 if [ "$network" == "${netrenamed}dhcp" ]; then
12 if [ "$cleanup" == 1 ]; then
13 section_cleanup luci_splash.$1
14 else
15 if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
16 section_rename luci_splash $1 ${netrenamed}dhcp
17 fi
18 fi
19 fi
20 }
21 config_load luci_splash
22 config_foreach handle_splash iface
23
24 uci batch << EOF
25 set luci_splash.${netrenamed}dhcp="iface"
26 set luci_splash.${netrenamed}dhcp.network="${net}dhcp"
27 set luci_splash.${netrenamed}dhcp.zone="freifunk"
28 EOF
29
30 echo " network: ${netrenamed}dhcp"
31
32 uci commit