projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc8eaf6
)
contrib/meshwizard: Cleanup and add ssid_scheme option
author
Manuel Munz
<freifunk@somakoma.de>
Wed, 21 Sep 2011 16:43:38 +0000
(16:43 +0000)
committer
Manuel Munz
<freifunk@somakoma.de>
Wed, 21 Sep 2011 16:43:38 +0000
(16:43 +0000)
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
patch
|
blob
|
history
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
patch
|
blob
|
history
diff --git
a/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
b/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
index
5e0e194
..
689289b
100644
(file)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
@@
-12,11
+12,21
@@
uci_remove_list_element() {
done
}
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
set_defaults() {
for def in $(env |grep "^$1"); do
option=${def/$1/}
uci set $2.$option
- echo " ${option/=/: }"
done
}
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
}
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."
}
msg_cleanup() {
echo " Cleanup: Removed section $1."
}
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
4c7ea5a
..
06f80d8
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh
@@
-23,11
+23,10
@@
config_foreach handle_dnsmasq dhcp
uci batch << EOF
set dhcp.${netrenamed}dhcp="dhcp"
uci batch << EOF
set dhcp.${netrenamed}dhcp="dhcp"
-set dhcp.${netrenamed}dhcp.leasetime="$
{dhcp_leasetime}
"
-set dhcp.${netrenamed}dhcp.force="
1
"
+set dhcp.${netrenamed}dhcp.leasetime="$
dhcp_leasetime
"
+set dhcp.${netrenamed}dhcp.force="
$dhcp_force
"
set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
EOF
set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
EOF
-echo " leasetime: ${dhcp_leasetime}
- interface: ${netrenamed}dhcp"
+uci_commitverbose "Setup DHCP for $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
517b4fd
..
26a896b
100755
(executable)
--- 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,19
+13,12
@@
handle_dhcp() {
config_load dhcp
config_foreach handle_dhcp dnsmasq
config_load dhcp
config_foreach handle_dhcp dnsmasq
-echo " + Setup dnsmasq"
-
uci set dhcp.dnsmasq.local="/$profile_suffix/"
uci set dhcp.dnsmasq.domain="$profile_suffix"
uci set dhcp.dnsmasq.local="/$profile_suffix/"
uci set dhcp.dnsmasq.domain="$profile_suffix"
-echo " local: /$profile_suffix/
- domain: $profile_suffix"
-
config_get addnhosts dnsmasq addnhosts
if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then
uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr"
config_get addnhosts dnsmasq addnhosts
if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then
uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr"
- echo " addnhosts: /var/etc/hosts.olsr"
fi
fi
-uci commit
-
+uci_commitverbose "Setup dnsmasq" dhcp
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
c968142
..
e7e453d
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
@@
-19,7
+19,7
@@
handle_zonewan() {
uci set firewall.$1.local_restrict=1
fi
}
uci set firewall.$1.local_restrict=1
fi
}
-config_foreach handle_zonewan zone &&
echo " + Enable local_restrict for zone wan"
+config_foreach handle_zonewan zone &&
uci_commitverbose "Enable local_restrict for zone wan" firewall
# Delete old firewall zone for freifunk
handle_fwzone() {
# Delete old firewall zone for freifunk
handle_fwzone() {
@@
-69,8
+69,6
@@
fi
# setup freifunk firewall zone
# setup freifunk firewall zone
-echo " + Setup firewall zone."
-
# add $netrenamed and if needed ${netrenamed}dhcp to the networks for this zone
config_get network zone_freifunk network
# add $netrenamed and if needed ${netrenamed}dhcp to the networks for this zone
config_get network zone_freifunk network
@@
-93,15
+91,10
@@
set firewall.zone_freifunk.forward="$zone_freifunk_forward"
set firewall.zone_freifunk.output="$zone_freifunk_output"
EOF
set firewall.zone_freifunk.output="$zone_freifunk_output"
EOF
-echo " network: $network
- input: $zone_freifunk_input
- forward: $zone_freifunk_forward
- output: $zone_freifunk_output"
+uci_commitverbose "Setup freifunk firewall zone" firewall
# Usually we need to setup masquerading for lan, except lan is an olsr interface or has an olsr hna
# Usually we need to setup masquerading for lan, except lan is an olsr interface or has an olsr hna
-echo " + Setup masquerading rules"
-
handle_interface() {
config_get interface "$1" interface
if [ "$interface" == "lan" ]; then
handle_interface() {
config_get interface "$1" interface
if [ "$interface" == "lan" ]; then
@@
-121,7
+114,7
@@
config_foreach handle_hna Hna4
currms=$(uci -q get firewall.zone_freifunk.masq_src)
if [ ! "$no_masq_lan" == "1" ]; then
currms=$(uci -q get firewall.zone_freifunk.masq_src)
if [ ! "$no_masq_lan" == "1" ]; then
- uci set firewall.zone_freifunk.masq="1"
&& echo " Enabled masquerading." || echo -e "\033[1mWarning:\033[0m: Could not enable masquerading."
+ uci set firewall.zone_freifunk.masq="1"
[ -z "$(echo $currms |grep lan)" ] && uci add_list firewall.zone_freifunk.masq_src="lan"
fi
[ -z "$(echo $currms |grep lan)" ] && uci add_list firewall.zone_freifunk.masq_src="lan"
fi
@@
-137,11
+130,11
@@
for i in $networks; do
fi
done
fi
done
+uci_commitverbose "Setup masquerading rules" firewall
+
# Rules, Forwardings, advanced config and includes
# Clear firewall configuration
# Rules, Forwardings, advanced config and includes
# Clear firewall configuration
-echo " + Setup rules, forwardings, advanced config and includes."
-
for config in freifunk profile_$community; do
config_load $config
for config in freifunk profile_$community; do
config_load $config
@@
-158,4
+151,4
@@
for config in freifunk profile_$community; do
done
done
done
done
-uci
commit
+uci
_commitverbose "Setup rules, forwardings, advanced config and includes." firewall
diff --git
a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
index
7c66e63
..
0e6e7df
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
@@
-1,7
+1,6
@@
#!/bin/sh
# Sets values in /etc/config/freifunk
#!/bin/sh
# Sets values in /etc/config/freifunk
-. /etc/functions.sh
. $dir/functions.sh
# Set community homepage
. $dir/functions.sh
# Set community homepage
@@
-11,4
+10,5
@@
if [ -n "$hp" ]; then
uci set freifunk.community.homepage="$hp"
fi
uci set freifunk.community.homepage="$hp"
fi
+uci_commitverbose "/etc/init.d/freifunk config" freifunk
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
4f03d22
..
493c701
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
@@
-14,7
+14,6
@@
fi
ipaddr=$(uci get meshwizard.netconfig.$net\_ip4addr)
[ -z "$ipaddr" ] && msg_missing_value meshwizard $net\_ip4addr
ipaddr=$(uci get meshwizard.netconfig.$net\_ip4addr)
[ -z "$ipaddr" ] && msg_missing_value meshwizard $net\_ip4addr
-
[ -z "$interface_netmask" ] && interface netmask="255.255.0.0"
uci batch << EOF
[ -z "$interface_netmask" ] && interface netmask="255.255.0.0"
uci batch << EOF
@@
-25,8
+24,7
@@
set network.$netrenamed.netmask="$interface_netmask"
set network.$netrenamed.dns="$interface_dns"
EOF
set network.$netrenamed.dns="$interface_dns"
EOF
-echo " IP address: $ipaddr"
-echo " Netmask : $interface_netmask"
+uci_commitverbose "Setup interface $netrenamed" network
# setup dhcp alias/interface
# setup dhcp alias/interface
@@
-68,10
+66,8
@@
if [ "$net_dhcp" == 1 ]; then
# Setup alias for $net
if [ "$vap" == 1 ]; then
# Setup alias for $net
if [ "$vap" == 1 ]; then
- echo " + Setup interface ${netrenamed}dhcp."
uci set network.${netrenamed}dhcp=interface
else
uci set network.${netrenamed}dhcp=interface
else
- echo " + Setup alias interface ${netrenamed}dhcp."
uci set network.${netrenamed}dhcp=alias
uci set network.${netrenamed}dhcp.interface="$netrenamed"
fi
uci set network.${netrenamed}dhcp=alias
uci set network.${netrenamed}dhcp.interface="$netrenamed"
fi
@@
-82,10
+78,6
@@
set network.${netrenamed}dhcp.ipaddr="$START"
set network.${netrenamed}dhcp.netmask="$NETMASK"
EOF
set network.${netrenamed}dhcp.netmask="$NETMASK"
EOF
- echo " interface: $net
- ipaddr: $START
- netmask: $NETMASK"
-
fi
fi
-uci
commit
+uci
_commitverbose "Setup interface for ${netrenamed}dhcp" network
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
d298828
..
06cc2e5
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
@@
-5,7
+5,6
@@
net=$1
. /etc/functions.sh
net=$1
. /etc/functions.sh
-
. $dir/functions.sh
# Clean or delete interface defaults
. $dir/functions.sh
# Clean or delete interface defaults
@@
-24,9
+23,9
@@
config_foreach handle_interfacedefaults InterfaceDefaults
# Setup new InterfaceDefaults
# Setup new InterfaceDefaults
-echo " + Setup InterfaceDefaults"
uci set olsrd.InterfaceDefaults=InterfaceDefaults
set_defaults "olsr_interfacedefaults_" olsrd.InterfaceDefaults
uci set olsrd.InterfaceDefaults=InterfaceDefaults
set_defaults "olsr_interfacedefaults_" olsrd.InterfaceDefaults
+uci_commitverbose "Setup olsr interface defaults" olsrd
# Delete old interface for $netrenamed
handle_interface() {
# Delete old interface for $netrenamed
handle_interface() {
@@
-44,14
+43,11
@@
config_foreach handle_interface Interface
# Setup new interface for $netrenamed
# Setup new interface for $netrenamed
-echo " + Setup Interface"
-
uci set olsrd.$netrenamed=Interface
uci set olsrd.$netrenamed=Interface
-
set_defaults "olsr_interface_" olsrd.$net
set_defaults "olsr_interface_" olsrd.$net
-
uci set olsrd.$netrenamed.interface="$netrenamed"
uci set olsrd.$netrenamed.interface="$netrenamed"
-echo " interface: $netrenamed"
+
+uci_commitverbose "Setup olsr interface for $netrenamed." olsrd
# If dhcp-network is inside the mesh_network then add HNA for it
dhcprange=$(uci get meshwizard.netconfig.$net\_dhcprange)
# If dhcp-network is inside the mesh_network then add HNA for it
dhcprange=$(uci get meshwizard.netconfig.$net\_dhcprange)
@@
-63,19
+59,16
@@
uci -q delete olsrd.${netrenamed}clients
dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
if [ "$dhcpinmesh" == 1 ]; then
dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
if [ "$dhcpinmesh" == 1 ]; then
- echo " + Setting up HNA"
uci set olsrd.${netrenamed}clients="Hna4"
eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange)
uci set olsrd.${netrenamed}clients.netaddr="$NETWORK"
uci set olsrd.${netrenamed}clients.netmask="$NETMASK"
uci set olsrd.${netrenamed}clients="Hna4"
eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange)
uci set olsrd.${netrenamed}clients.netaddr="$NETWORK"
uci set olsrd.${netrenamed}clients.netmask="$NETMASK"
- echo " netaddr: $NETWORK"
- echo " natmask: $NETMASK"
+ uci_commitverbose "Setup HNA for network $dhcprange" olsrd
fi
# Delete nameservice, dyngw and httpinfo plugins
fi
# Delete nameservice, dyngw and httpinfo plugins
-echo " + Configure Plugins"
handle_plugin() {
config_get library "$1" library
if [ "$cleanup" == 1 ]; then
handle_plugin() {
config_get library "$1" library
if [ "$cleanup" == 1 ]; then
@@
-105,7
+98,7
@@
set olsrd.olsrd_nameservice.sighup_pid_file="/var/run/dnsmasq.pid"
set olsrd.olsrd_nameservice.suffix="$suffix"
EOF
set olsrd.olsrd_nameservice.suffix="$suffix"
EOF
-echo " Nameservice Plugin configured."
+uci_commitverbose "Setup olsr nameservice plugin" olsrd
# Setup dyngw_plain
# Setup dyngw_plain
@@
-117,10
+110,9
@@
if [ -n "$(uci -q get olsrd.dyngw_plain.library)" ]; then
fi
if [ "$sharenet" == 1 ]; then
fi
if [ "$sharenet" == 1 ]; then
- echo " + Setup dyngw_plain"
uci set olsrd.dyngw_plain=LoadPlugin
uci set olsrd.dyngw_plain.ignore=0
uci set olsrd.dyngw_plain.library="olsrd_dyn_gw_plain.so.0.4"
uci set olsrd.dyngw_plain=LoadPlugin
uci set olsrd.dyngw_plain.ignore=0
uci set olsrd.dyngw_plain.library="olsrd_dyn_gw_plain.so.0.4"
+ uci_commitverbose "Setup olsrd_dyngw_plain plugin"
fi
fi
-uci commit
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
b28ccc9
..
86f60ae
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
@@
-27,9
+27,7
@@
set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
set luci_splash.${netrenamed}dhcp.zone="freifunk"
EOF
set luci_splash.${netrenamed}dhcp.zone="freifunk"
EOF
-echo " network: ${netrenamed}dhcp"
-
-uci commit
+uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
/etc/init.d/luci_splash enable
/etc/init.d/luci_splash enable
diff --git
a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
index
d6b30e3
..
2c3081e
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
@@
-1,12
+1,12
@@
#!/bin/sh
# Sets values from /etc/config/freifunk and/or the community profile in /etc/config/system
#!/bin/sh
# Sets values from /etc/config/freifunk and/or the community profile in /etc/config/system
+. $dir/functions.sh
+
if [ -n "$(env | grep '^system_')" ]; then
if [ -n "$(env | grep '^system_')" ]; then
- echo "++++ Setup system"
env | grep "^system_" | sed "s/system_/uci set system.system./g" | while read line; do
eval $line
env | grep "^system_" | sed "s/system_/uci set system.system./g" | while read line; do
eval $line
- echo " $line"
done
fi
done
fi
-uci
commit
system
+uci
_commitverbose "System config"
system
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
150e412
..
1feff0d
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
@@
-8,8
+8,6
@@
net="$1"
##### wifi-device #####
##### wifi-device #####
-echo " + Setup wifi-device"
-
# Get the type before we delete the wifi-device
config_load wireless
config_get type $net type
# Get the type before we delete the wifi-device
config_load wireless
config_get type $net type
@@
-45,13
+43,10
@@
set wireless.${net}.type="$type"
set wireless.${net}.channel="$channel"
EOF
set wireless.${net}.channel="$channel"
EOF
-echo " Type: $type"
-echo " Channel: $channel"
+uci_commitverbose "Setup wifi device for $netrenamed" wireless
##### wifi iface
##### wifi iface
-echo " + Setup wifi-iface"
-
# Delete old wifi-iface for $net
handle_interface() {
config_get device "$1" device
# Delete old wifi-iface for $net
handle_interface() {
config_get device "$1" device
@@
-75,17
+70,19
@@
set_defaults "wifi_iface_" wireless.$net\_iface
# overwrite defaults
bssid="$($dir/helpers/gen_bssid.sh $channel $community)"
# overwrite defaults
bssid="$($dir/helpers/gen_bssid.sh $channel $community)"
+ssid="$profile_ssid"
+if [ "$profile_ssid_scheme" == "addchannel" ]; then
+ ssid="$ssid - ch$channel"
+fi
+
uci batch << EOF
set wireless.$net\_iface.device="${net}"
set wireless.$net\_iface.network="$netrenamed"
uci batch << EOF
set wireless.$net\_iface.device="${net}"
set wireless.$net\_iface.network="$netrenamed"
-set wireless.$net\_iface.ssid="$
profile_ssid - ch$channel
"
+set wireless.$net\_iface.ssid="$
ssid
"
set wireless.$net\_iface.bssid="$bssid"
EOF
set wireless.$net\_iface.bssid="$bssid"
EOF
-echo " device: $net
- network: $netrenamed
- ssid: $profile_ssid - ch$channel
- bssid: $bssid"
+uci_commitverbose "Setup wifi interface for $netrenamed" wireless
## VAP
ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
## VAP
ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
@@
-98,10
+95,6
@@
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
set wireless.$net\_iface_dhcp.network="${netrenamed}dhcp"
set wireless.$net\_iface_dhcp.ssid="FF-AP-$ip4addr"
EOF
- echo " + Setting up VAP interface for $net
- device: $net
- network: ${netrenamed}dhcp
- ssid: AP-$profile_ssid-$ip4addr"
+ uci_commitverbose "Setup VAP interface for $netrenamed" wireless
fi
fi
-uci commit
diff --git
a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
index
a5f9a2f
..
c03d11f
100755
(executable)
--- a/
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
+++ b/
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
@@
-4,17
+4,21
@@
. /etc/functions.sh
. /etc/functions.sh
+echo "
+Meshwizard 0.0.3
+"
+
# config
export dir="/usr/bin/meshwizard"
. $dir/functions.sh
debug=1
# Rename wifi interfaces
# config
export dir="/usr/bin/meshwizard"
. $dir/functions.sh
debug=1
# Rename wifi interfaces
- echo "+
+++
Renaming wifi-devices in /etc/config/meshwizard"
+ echo "+ Renaming wifi-devices in /etc/config/meshwizard"
$dir/helpers/rename-wifi.sh
# Firstboot/initial config
$dir/helpers/rename-wifi.sh
# Firstboot/initial config
- echo "+
+++
Initial config"
+ echo "+ Initial config"
$dir/helpers/initial_config.sh
# Get community
$dir/helpers/initial_config.sh
# Get community
@@
-32,9
+36,8
@@
export networks
[ -z "$networks" ] && echo "Error: No networks to setup could be found in /etc/config/meshwizard, aborting now." && exit 1
[ -z "$networks" ] && echo "Error: No networks to setup could be found in /etc/config/meshwizard, aborting now." && exit 1
-echo "+++ wizard 0.0.2 +++
-Community=$community
-Network(s)=$networks"
+echo " Community=$community
+ Network(s)=$networks"
# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community,
# last will overwrite first
# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community,
# last will overwrite first
@@
-45,17
+48,9
@@
while read line; do
export "${line//\"/}"
done < /tmp/meshwizard.tmp
export "${line//\"/}"
done < /tmp/meshwizard.tmp
-# dnsmasq
- echo "++++ dnsmasq config"
- $dir/helpers/setup_dnsmasq.sh
-
-# system
- echo "++++ system config"
- $dir/helpers/setup_system.sh
-
-# freifunk
- echo "++++ /etc/config/freifunk config"
- $dir/helpers/setup_freifunk.sh
+$dir/helpers/setup_dnsmasq.sh
+$dir/helpers/setup_system.sh
+$dir/helpers/setup_freifunk.sh
# Configure found networks
for net in $networks; do
# Configure found networks
for net in $networks; do
@@
-63,36
+58,17
@@
for net in $networks; do
netrenamed="${net/radio/wireless}"
export netrenamed
netrenamed="${net/radio/wireless}"
export netrenamed
- echo "++++ Configure interface $net"
-
- config="network"
- echo "$(msg_start $config)"
$dir/helpers/setup_network.sh $net
$dir/helpers/setup_network.sh $net
-
- config="wireless"
- echo "$(msg_start $config)"
$dir/helpers/setup_wifi.sh $net
$dir/helpers/setup_wifi.sh $net
-
- config="OLSRd"
- echo "$(msg_start $config)"
$dir/helpers/setup_olsrd.sh $net
net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp)
if [ "$net_dhcp" == 1 ]; then
$dir/helpers/setup_olsrd.sh $net
net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp)
if [ "$net_dhcp" == 1 ]; then
- config="DHCP"
- echo "$(msg_start $config)"
$dir/helpers/setup_dhcp.sh $net
fi
$dir/helpers/setup_dhcp.sh $net
fi
- config="luci_splash"
- echo "$(msg_start $config)"
$dir/helpers/setup_splash.sh $net
$dir/helpers/setup_splash.sh $net
-
- config="firewall"
- echo "$(msg_start $config)"
$dir/helpers/setup_firewall.sh $net
$dir/helpers/setup_firewall.sh $net
-
- echo " Configuration of $net finished."
done
##### Reboot the router (because simply restarting services gave errors)
done
##### Reboot the router (because simply restarting services gave errors)