summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-10-26 13:55:24 +0000
committerManuel Munz <freifunk@somakoma.de>2011-10-26 13:55:24 +0000
commita4a93146515a28e6cc14560700c573b6cd788172 (patch)
tree9b34ff1ed632548ecdd3eefa6d2724a814869ef3
parent5654bb7ef6e72734f1f3fcfd6ce2ee1382d8335a (diff)
contrib/meshwizard: Better formatting
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh4
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh6
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh10
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh19
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh12
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh8
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wan_static.sh38
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh28
8 files changed, 65 insertions, 60 deletions
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
index 51fb235c14..0a5c96b860 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
@@ -18,8 +18,8 @@ config_load dhcp
config_foreach handle_dnsmasq dhcp
uci batch << EOF
-set dhcp.${netrenamed}dhcp="dhcp"
-set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
+ set dhcp.${netrenamed}dhcp="dhcp"
+ set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
EOF
set_defaults "dhcp_" dhcp.${netrenamed}dhcp
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh
index 26a896bc7b..2b32f24ab2 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh
@@ -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
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
index f5c44161ec..14134e5c6d 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
@@ -48,11 +48,11 @@ handle_fwzone() {
config_foreach handle_fwzone zone
uci batch << EOF
-set firewall.zone_freifunk="zone"
-set firewall.zone_freifunk.name="freifunk"
-set firewall.zone_freifunk.input="$zone_freifunk_input"
-set firewall.zone_freifunk.forward="$zone_freifunk_forward"
-set firewall.zone_freifunk.output="$zone_freifunk_output"
+ set firewall.zone_freifunk="zone"
+ set firewall.zone_freifunk.name="freifunk"
+ set firewall.zone_freifunk.input="$zone_freifunk_input"
+ set firewall.zone_freifunk.forward="$zone_freifunk_forward"
+ set firewall.zone_freifunk.output="$zone_freifunk_output"
EOF
uci_commitverbose "Setup firewall zones" firewall
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
index 1d4c3ba7e1..90e6248c4e 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
@@ -12,10 +12,11 @@ ipaddr=$(uci get meshwizard.netconfig.$net\_ip4addr)
[ -z "$interface_netmask" ] && interface netmask="255.255.0.0"
uci batch << EOF
-set network.$netrenamed="interface"
-set network.$netrenamed.proto="static"
-set network.$netrenamed.ipaddr="$ipaddr"
+ 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,12 +62,12 @@ if [ "$net_dhcp" == 1 ]; then
uci set network.${netrenamed}dhcp.interface="$netrenamed"
fi
- uci batch << EOF
- set network.${netrenamed}dhcp.proto=static
- set network.${netrenamed}dhcp.ipaddr="$START"
- set network.${netrenamed}dhcp.netmask="$NETMASK"
- uci_commitverbose "Setup interface for ${netrenamed}dhcp" network
-EOF
+ uci batch <<- EOF
+ set network.${netrenamed}dhcp.proto=static
+ set network.${netrenamed}dhcp.ipaddr="$START"
+ set network.${netrenamed}dhcp.netmask="$NETMASK"
+ uci_commitverbose "Setup interface for ${netrenamed}dhcp" network
+ EOF
fi
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
index 39a4849c82..b4de9ce194 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
@@ -37,12 +37,12 @@ else
suffix=".olsr"
fi
uci batch << EOF
-set olsrd.olsrd_nameservice=LoadPlugin
-set olsrd.olsrd_nameservice.library="olsrd_nameservice.so.0.3"
-set olsrd.olsrd_nameservice.latlon_file="/var/run/latlon.js"
-set olsrd.olsrd_nameservice.hosts_file="/var/etc/hosts.olsr"
-set olsrd.olsrd_nameservice.sighup_pid_file="/var/run/dnsmasq.pid"
-set olsrd.olsrd_nameservice.suffix="$suffix"
+ set olsrd.olsrd_nameservice=LoadPlugin
+ set olsrd.olsrd_nameservice.library="olsrd_nameservice.so.0.3"
+ set olsrd.olsrd_nameservice.latlon_file="/var/run/latlon.js"
+ set olsrd.olsrd_nameservice.hosts_file="/var/etc/hosts.olsr"
+ set olsrd.olsrd_nameservice.sighup_pid_file="/var/run/dnsmasq.pid"
+ set olsrd.olsrd_nameservice.suffix="$suffix"
EOF
uci_commitverbose "Setup olsr nameservice plugin" olsrd
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
index afbe1d5dae..16cd71dc95 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
@@ -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
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wan_static.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wan_static.sh
index e41695f8c3..a1bec345ca 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wan_static.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wan_static.sh
@@ -21,28 +21,28 @@ uci delete meshwizard.wan && uci commit meshwizard
# Firewall rules to allow incoming ssh and web
if [ "$wan_allowssh" == 1 ]; then
- uci batch << EOF
-set firewall.wanssh=rule
-set firewall.wanssh.src=wan
-set firewall.wanssh.target=ACCEPT
-set firewall.wanssh.proto=tcp
-set firewall.wanssh.dest_port=22
-EOF
+ uci batch <<- EOF
+ set firewall.wanssh=rule
+ set firewall.wanssh.src=wan
+ set firewall.wanssh.target=ACCEPT
+ set firewall.wanssh.proto=tcp
+ set firewall.wanssh.dest_port=22
+ EOF
uci_commitverbose "Allow incoming connections to port 22 (ssh) on wan" firewall
fi
if [ "$wan_allowweb" == 1 ]; then
- uci batch << EOF
-set firewall.wanweb=rule
-set firewall.wanweb.src=wan
-set firewall.wanweb.target=ACCEPT
-set firewall.wanweb.proto=tcp
-set firewall.wanweb.dest_port=80
-set firewall.wanwebhttps=rule
-set firewall.wanwebhttps.src=wan
-set firewall.wanwebhttps.target=ACCEPT
-set firewall.wanwebhttps.proto=tcp
-set firewall.wanwebhttps.dest_port=443
-EOF
+ uci batch <<- EOF
+ set firewall.wanweb=rule
+ set firewall.wanweb.src=wan
+ set firewall.wanweb.target=ACCEPT
+ set firewall.wanweb.proto=tcp
+ set firewall.wanweb.dest_port=80
+ set firewall.wanwebhttps=rule
+ set firewall.wanwebhttps.src=wan
+ set firewall.wanwebhttps.target=ACCEPT
+ set firewall.wanwebhttps.proto=tcp
+ set firewall.wanwebhttps.dest_port=443
+ EOF
uci_commitverbose "Allow incoming connections to port 80 and 443 (http and https) on wan" firewall
fi
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
index 52db4d944e..55965dc61a 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
@@ -35,8 +35,8 @@ if [ -z "$channel" -o "$channel" == "default" ]; then
fi
uci batch << EOF
-set wireless.${net}.type="$type"
-set wireless.${net}.channel="$channel"
+ set wireless.${net}.type="$type"
+ set wireless.${net}.channel="$channel"
EOF
uci_commitverbose "Setup wifi device for $netrenamed" wireless
@@ -69,10 +69,10 @@ if [ "$profile_ssid_scheme" == "addchannel" ]; then
fi
uci batch << EOF
-set wireless.$net\_iface.device="${net}"
-set wireless.$net\_iface.network="$netrenamed"
-set wireless.$net\_iface.ssid="$ssid"
-set wireless.$net\_iface.bssid="$bssid"
+ set wireless.$net\_iface.device="${net}"
+ set wireless.$net\_iface.network="$netrenamed"
+ set wireless.$net\_iface.ssid="$ssid"
+ set wireless.$net\_iface.bssid="$bssid"
EOF
uci_commitverbose "Setup wifi interface for $netrenamed" wireless
@@ -80,14 +80,14 @@ 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
-set wireless.$net\_iface_dhcp="wifi-iface"
-set wireless.$net\_iface_dhcp.device="$net"
-set wireless.$net\_iface_dhcp.mode="ap"
-set wireless.$net\_iface_dhcp.encryption="none"
-set wireless.$net\_iface_dhcp.network="${netrenamed}dhcp"
-set wireless.$net\_iface_dhcp.ssid="FF-AP-$ip4addr"
-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"
+ set wireless.$net\_iface_dhcp.encryption="none"
+ set wireless.$net\_iface_dhcp.network="${netrenamed}dhcp"
+ set wireless.$net\_iface_dhcp.ssid="FF-AP-$ip4addr"
+ EOF
uci_commitverbose "Setup VAP interface for $netrenamed" wireless
fi