contrib/meshwizard: Better formatting

This commit is contained in:
Manuel Munz 2011-10-26 13:55:24 +00:00
parent 5654bb7ef6
commit a4a9314651
8 changed files with 65 additions and 60 deletions

View file

@ -13,8 +13,10 @@ handle_dhcp() {
config_load dhcp
config_foreach handle_dhcp dnsmasq
uci set dhcp.dnsmasq.local="/$profile_suffix/"
uci set dhcp.dnsmasq.domain="$profile_suffix"
uci batch << EOF
set dhcp.dnsmasq.local="/$profile_suffix/"
set dhcp.dnsmasq.domain="$profile_suffix"
EOF
config_get addnhosts dnsmasq addnhosts
if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then

View file

@ -16,6 +16,7 @@ set network.$netrenamed="interface"
set network.$netrenamed.proto="static"
set network.$netrenamed.ipaddr="$ipaddr"
EOF
set_defaults "interface_" network.$netrenamed
uci_commitverbose "Setup interface $netrenamed" network
@ -61,7 +62,7 @@ if [ "$net_dhcp" == 1 ]; then
uci set network.${netrenamed}dhcp.interface="$netrenamed"
fi
uci batch << EOF
uci batch <<- EOF
set network.${netrenamed}dhcp.proto=static
set network.${netrenamed}dhcp.ipaddr="$START"
set network.${netrenamed}dhcp.netmask="$NETMASK"

View file

@ -25,9 +25,11 @@ if [ "$dhcp_range" == 1 ]; then
config_load luci_splash
config_foreach handle_splash iface
uci set luci_splash.${netrenamed}dhcp="iface"
uci set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
uci set luci_splash.${netrenamed}dhcp.zone="freifunk"
uci batch <<- EOF
set luci_splash.${netrenamed}dhcp="iface"
set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
set luci_splash.${netrenamed}dhcp.zone="freifunk"
EOF
uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
/etc/init.d/luci_splash enable

View file

@ -21,7 +21,7 @@ uci delete meshwizard.wan && uci commit meshwizard
# Firewall rules to allow incoming ssh and web
if [ "$wan_allowssh" == 1 ]; then
uci batch << EOF
uci batch <<- EOF
set firewall.wanssh=rule
set firewall.wanssh.src=wan
set firewall.wanssh.target=ACCEPT
@ -32,7 +32,7 @@ EOF
fi
if [ "$wan_allowweb" == 1 ]; then
uci batch << EOF
uci batch <<- EOF
set firewall.wanweb=rule
set firewall.wanweb.src=wan
set firewall.wanweb.target=ACCEPT

View file

@ -80,7 +80,7 @@ uci_commitverbose "Setup wifi interface for $netrenamed" wireless
## VAP
ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
if [ "$type" == "atheros" -a "$vap" == 1 ]; then
uci batch << EOF
uci batch <<- EOF
set wireless.$net\_iface_dhcp="wifi-iface"
set wireless.$net\_iface_dhcp.device="$net"
set wireless.$net\_iface_dhcp.mode="ap"