Developing lightweight computation at the DSG edge

Commit f5a083d3 authored by p4u's avatar p4u
Browse files

* Add support for ADHC_AP mode

* Add support for WPA encryption in AP mode
* Add smart autoconfiguration of network interfaces (lan, mesh and wan)
* Adds support for 802.11b networks (channel 6b)
* Add network auto-configuration system to select WAN/LAN/Mesh ifaces depending on devicec
* Improve the Wifi auto-configuration (smarter decisions)
* Improve the Wifi templates system (now split in ifaces/devices)
* Upgrade bmx6 to the last version with tunnel creation on-demand
* Clean and improve the LUCI web interface
* Small fixes/improvements found in the way

Merge branch 'adhoc_vap' into testing
parents ac63b080 2371d29a
......@@ -4,4 +4,4 @@ src-link packages PATH/packages
src-link qmp_packages PATH/qmp/packages
src-git b6m_packages git://qmp.cat/b6m.git;openwrt
src-git luci git://nbd.name/luci.git
src-git openwrt_routing git://github.com/openwrt-routing/packages.git
src-git openwrt_routing git://github.com/openwrt-routing/packages.git;bmx6_testing
......@@ -39,7 +39,7 @@ define Package/qmp-system
SECTION:=net
CATEGORY:=qMp
URL:=http://qmp.cat
DEPENDS:=
DEPENDS:=+luci-lib-core +luci-lib-nixio +luci-lib-sys +luci-lib-web
endef
define Package/qmp-system/description
......
## this config should work for Routerstation(PRO), Alix, Fonera, ...
#
# Contributors:
# Simó Albert i Beltran
#
config 'qmp' 'interfaces'
# option 'configure_switch' 'eth0' # (uncomment line if available, e.g. WGT634U)
option 'lan_devices' 'eth0 wlan1 dummy0' # will be used as is!
option 'wan_devices' 'eth1' # will be used as is!
option 'mesh_devices' 'wlan0 wlan2 eth0 eth1' # will be extended by vlan tag!
# option 'configure_switch' 'eth0' # (uncomment line if available, e.g. WGT634U)
option 'lan_devices' 'eth0 wlan1 dummy0' # will be used for LAN
option 'wan_devices' 'eth1' # will be used for WAN
option 'mesh_devices' 'wlan0 wlan2 eth0 eth1' # will be extended by vlan tag for by uses as Mesh
# option 'no_vlan_devices' '' # interfaces which won't be vlan tagged
config 'qmp' 'node'
option 'primary_device' 'eth0'
......@@ -25,43 +19,37 @@ config 'qmp' 'update'
option 'preserve' '/etc/config/qmp /etc/shadow /etc/passwd /etc/rc.local /etc/firewall.user /etc/dropbear/* /etc/config/b6m-spread'
config 'qmp' 'non_overlapping'
option 'ignore' '0' # Each node assings a non-overlapping DHCP IPv4 ranges over a /16 network on lan device
option 'dhcp_offset' '2'
option 'qmp_leasetime' '1h'
# Each node assings a non-overlapping DHCP IPv4 ranges over a /16 network on lan device
option 'ignore' '0'
option 'dhcp_offset' '2'
option 'qmp_leasetime' '1h'
config 'qmp' 'networks'
option 'dns' '141.1.1.1 85.126.4.170 202.83.95.227'
option 'lan_address' '172.30.22.1'
option 'lan_netmask' '255.255.255.0'
#option 'publish_lan' '0'
#option 'niit_prefix96' '0:0:0:0:0:ffff' # omit trailing 32 ipv4 bits !
option 'mesh_protocol_vids' 'olsr6:1 bmx6:2' # means olsr6 use vlantag 10+1, bmx6 use vlantag 10+2
option 'mesh_vid_offset' '10'
option 'dns' '141.1.1.1 85.126.4.170 202.83.95.227'
option 'lan_address' '172.30.22.1'
option 'lan_netmask' '255.255.255.0'
#option 'publish_lan' '0' # deprecated
option 'mesh_protocol_vids' 'olsr6:1 bmx6:2' # means olsr6 use vlantag 10+1, bmx6 use vlantag 10+2
option 'mesh_vid_offset' '10'
option 'rescue_prefix24' '169.254' # rescue network prefix, the 16 missing bits are taken from device MAC
option 'olsr6_mesh_prefix48' 'fd01:0:0'
option 'olsr6_ripe_prefix48' '2011:0:0'
option 'bmx6_mesh_prefix48' 'fd02:0:0'
option 'bmx6_ripe_prefix48' '2012:0:0' # suffix is autoconfigured based on community_node_id
option 'bmx6_ipv4_prefix24' '10.202.0' # last 8 bits are autoconfigured based on MAC
# option 'bmx6_ipv4_address' '' # specify it if you want to have a specific IPv4 address
# Deprecated
# option 'bmx6_tablePrefTuns' '7000'
# option 'bmx6_tableTuns' '70'
# option 'bmx6_throwRules' '1'
option 'olsr6_mesh_prefix48' 'fd01:0:0'
option 'olsr6_ripe_prefix48' '2011:0:0'
option 'olsr6_ipv4_prefix24' '10.201'
# option 'olsr6_ipv4_address' '10.201.9.01'
# option 'olsr6_ipv4_netmask' '255.255.255.0'
# option 'olsr6_6to4_netmask' '120'
option 'bmx6_mesh_prefix48' 'fd02:0:0'
option 'bmx6_ripe_prefix48' '2012:0:0' # suffix is autoconfigured based on community_node_id
option 'bmx6_ipv4_prefix24' '10.202.0'
# option 'bmx6_ipv4_address' '10.202.9.01/24' # if commented out then option is autoconfigured based on
# community_node_id and bmx6_ipv4_prefix
option 'bmx6_tablePrefTuns' '7000'
option 'bmx6_tableTuns' '70'
option 'bmx6_throwRules' '1'
option 'babel_mesh_prefix48' 'fd03:0:0'
option 'netserver' '1'
config 'gateway'
option 'type' 'search'
option 'network' '::/0'
option 'tableRule' '32767/253'
config 'gateway'
option 'ignore' '1'
......@@ -72,6 +60,7 @@ config 'gateway'
option 'type' 'search'
option 'network' '0.0.0.0/0'
option 'maxPrefixLen' '0'
option 'tableRule' '32767/253'
config 'gateway'
option 'ignore' '1'
......@@ -109,8 +98,8 @@ config 'gateway'
option 'exportDistance' '10'
config 'qmp' 'wireless'
option 'driver' 'mac80211'
option 'country' 'SP'
option 'bssid' '02:CA:FF:EE:BA:BE'
option 'driver' 'mac80211'
option 'country' 'SP'
option 'bssid' '02:CA:FF:EE:BA:BE'
......@@ -45,8 +45,9 @@ configure() {
mv /etc/config/wireless /tmp/wireless.old
wifi detect | sed s/"disabled 1"/"country $country"/g > /etc/config/wireless
/etc/init.d/network reload
wifi down
wifi up
#To be sure channel is set...
iw reg set $country || iw reg set 00
......@@ -61,6 +62,7 @@ configure() {
#Configuring networking
echo "[Configuring networking]"
. $QMP_DIR/qmp_functions.sh
qmp_configure_initial
qmp_configure
#echo "Update hostname for: '$QMP_HOSTNAME'"
#echo "$QMP_HOSTNAME" > /proc/sys/kernel/hostname
......
......@@ -48,7 +48,9 @@ qmp_uci_get_raw() {
}
qmp_uci_set() {
uci -q set qmp.$1=$2 > /dev/null
section="$1"
shift
uci -q set qmp.$section="$@" > /dev/null
r=$?
uci commit
r=$(( $r + $? ))
......@@ -68,7 +70,7 @@ qmp_uci_set_raw() {
}
qmp_uci_del() {
uci -q del qmp.$1
uci -q delete qmp.$1
r=$?
uci commit
r=$(( $r + $? ))
......@@ -78,7 +80,7 @@ qmp_uci_del() {
}
qmp_uci_del_raw() {
uci -q del $@
uci -q delete $@
r=$?
uci commit
r=$(( $r + $? ))
......@@ -149,7 +151,7 @@ qmp_uci_import() {
}
qmp_uci_test() {
option=$1
option=$@
u="$(uci get $option > /dev/null 2>&1)"
r=$?
return $r
......@@ -182,7 +184,7 @@ qmp_debug() {
# Returns the names of the wifi devices from the system
qmp_get_wifi_devices() {
awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless
awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless | grep -v -e "wlan[0-9]-[0-9]"
}
# Returns the MAC address of the wifi devices
......@@ -216,7 +218,7 @@ qmp_get_mac_for_dev() {
# Returns the mac addres for specific device,, only wifi devs are allowed. Useful when eth and wlan have same MAC
# qmp_get_dev_from_wifi_mac 00:22:11:33:44:55
qmp_get_dev_from_wifi_mac() {
for device in $(qmp_get_wifi_devices)
for device in $(qmp_get_wifi_devices | sort)
do
if grep -q -i "^$1$" "/sys/class/net/$device/phy80211/macaddress" "/sys/class/net/$device/address" 2> /dev/null
then
......
......@@ -46,6 +46,11 @@ disable_default_gw() {
qmp_gw_apply
}
reset_wifi() {
qmp_reset_wifi
configure_wifi
}
configure_wifi() {
qmp_configure_wifi_initial
qmp_configure_wifi
......@@ -63,6 +68,7 @@ configure_network() {
/etc/init.d/network reload
/etc/init.d/dnsmasq restart
apply_netserver
qmp_restart_firewall
}
configure_system() {
......@@ -102,10 +108,11 @@ help() {
echo "Available functions:"
echo " offer_default_gw [ipv4|ipv6] : Offers default gw to the network IPv4 or IPv6, both versions if no value."
echo " search_default_gw [ipv4|ipv6] : Search for a default gw in the network IPv4 or IPv6, both versions if no value."
echo " disable_default_gw [ipv4|ipv6] : Disables the search/offer of default gw IPv4 and/or IPv6"
echo " configure_wifi : Configure and apply current wifi settings"
echo " configure_network : Configure and apply current network settings"
echo " configure_system : Configure and apply current system settings (qmp.node section and so on)"
echo " disable_default_gw [ipv4|ipv6] : Disables the search/offer of default GW IPv4 and/or IPv6"
echo " configure_wifi : Configure all WiFi devices"
echo " reset_wifi : Reset, rescan and configure all the WiFi devices"
echo " configure_network : Configure and apply network settings"
echo " configure_system : Configure and apply system settings (qmp.node section and so on)"
echo " publish_hna : Publish an IP range (v4 or v6): publish_hna <IP/NETMASK> [ID]"
echo " unpublish_hna : Unpublish a current HNA: unpublish_hna <ID>"
echo " apply_netserver : Start/stop nerserver depending on qmp configuration"
......
......@@ -20,6 +20,8 @@
# the file called "COPYING".
#
# Contributors:
# Axel Neumann
# Pau Escrich <p4u@dabax.net>
# Simó Albert i Beltran
#
......@@ -91,7 +93,7 @@ qmp_get_virtual_iface() {
fi
fi
# is lan?
# is lan?
if [ "$device" == "br-lan" ]; then
viface="lan"
echo $viface
......@@ -109,7 +111,7 @@ qmp_get_virtual_iface() {
[ -n "$viface" ] && { echo $viface; return; }
# id is the first and char and the numbers of the device [e]th[0] [w]lan[1]
local id_num=$(echo $device | tr -d "[A-z]")
local id_num=$(echo $device | tr -d "[A-z]" | tr - _)
local id_char=$(echo $device | cut -c 1)
# is wan
......@@ -178,18 +180,27 @@ qmp_get_devices() {
qmp_get_rescue_ip() {
local device=$1
local mac=""
[ -z "$device" ] && return 1
local rprefix=$(uci get qmp.networks.rescue_prefix24 2>/dev/null)
local rprefix=$(qmp_uci_get networks.rescue_prefix24 2>/dev/null)
[ -z "$rprefix" ] && return 0
# if device is virtual, get the ifname
if qmp_uci_test network.$device.ifname; then
device="$(uci get network.$device.ifname | tr -d @)"
local devvirt="$(qmp_uci_get_raw network.$device.ifname | tr -d @)"
device=${devvirt:-$device}
fi
local mac=$(ip addr show dev $device | grep -m 1 "link/ether" | awk '{print $2}')
[ -z "$mac" ] && return 2
# is it a wireless device?
if qmp_uci_test wireless.$device.device; then
local radio="$(qmp_uci_get_raw wireless.$device.device)"
mac=$(qmp_uci_get_raw wireless.$radio.macaddr)
else
mac=$(ip addr show dev $device | grep -m 1 "link/ether" | awk '{print $2}')
fi
[ -z "$mac" ] && return 1
#local xoctet=$(printf "%d\n" 0x$(echo $mac | cut -d: -f5))
local yoctet=$(printf "%d\n" 0x$(echo $mac | cut -d: -f6))
......@@ -198,25 +209,92 @@ qmp_get_rescue_ip() {
echo "$rip"
}
qmp_configure_smart_network() {
echo "---------------------------------------"
echo "Starting smart networking configuration"
echo "---------------------------------------"
local mesh=""
local wan=""
local lan=""
local dev=""
local phydevs=""
for dev in $(ls /sys/class/net/); do
[ -e /sys/class/net/$dev/device ] && phydevs="$phydevs $dev\n"
done
phydevs="$(echo -e "$phydevs" | grep -v -e ".*ap$" | grep -v "\\." | sort -u | tr -d ' ' \t)"
echo "Network devices found in system: $phydevs"
local is_eth0="$(echo -e "$phydevs" | grep -c eth0)"
[ $is_eth0 -gt 0 ] && {
lan="eth0"
mesh="eth0"
phydevs="$(echo -e "$phydevs" | grep -v eth0)"
}
local j=0
local mode=""
for dev in $phydevs; do
# if there is not yet a LAN device
[ -z "$lan" ] && lan="$dev" && continue
# if it is a wifi device
[ -e "/sys/class/net/$dev/phy80211" ] && {
j=0
while qmp_uci_test qmp.@wireless[$j]; do
[ "$(qmp_uci_get @wireless[$j].device)" == "$dev" ] && {
mode="$(qmp_uci_get @wireless[$j].mode)"
[ "$mode" == "ap" ] && lan="$dev $lan" || mesh="$dev $mesh"
break
}
j=$(($j+1))
done
} && continue
# if there is already LAN device and it is not wifi, use as WAN
[ -z "$wan" ] && wan="$dev" && continue
# else use as LAN and MESH
lan="$dev $lan"
mesh="$dev $mesh"
done
echo "Using them as:"
echo "- LAN $lan"
echo "- MESH $mesh"
echo "- WAN $wan"
qmp_uci_set interfaces.lan_devices "$lan"
qmp_uci_set interfaces.mesh_devices "$mesh"
qmp_uci_set interfaces.wan_devices "$wan"
}
qmp_attach_device_to_interface() {
local device=$1
local conf=$2
local interface=$3
local intype="$(uci -qX get network.$interface.type)"
local intype="$(qmp_uci_get_raw $conf.$interface.type)"
echo "Attaching device $device to interface $interface"
local wifi_config="$(uci -qX show wireless | sed -n -e "s/wireless\.\([^\.]\+\)\.device=$device/\1/p")"
if [ -n "$wifi_config" -a "wifi-iface" = "$(uci -q get wireless.$wifi_config)" ] ; then
uci set wireless.$wifi_config.network="$interface"
# is it a wifi device?
if qmp_uci_test wireless.$device; then
qmp_uci_set_raw wireless.$device.network="$interface"
uci commit wireless
echo " -> $device wireless attached to $interface"
# if it is not
else
if [ "$intype" == "bridge" ]; then
uci add_list $conf.$interface.ifname="$device"
else
uci set $conf.$interface.ifname="$device"
fi
if [ "$intype" == "bridge" ]; then
qmp_uci_add_list_raw $conf.$interface.ifname="$device"
echo " -> $device attached to $interface bridge"
else
qmp_uci_set_raw $conf.$interface.ifname="$device"
echo " -> $device attached to $interface"
fi
fi
}
qmp_configure_rescue_ip() {
......@@ -241,6 +319,8 @@ qmp_configure_rescue_ip() {
uci commit $conf
}
qmp_is_routerstationpro() {
cat /proc/cpuinfo | grep -q "^machine[[:space:]]*: Ubiquiti RouterStation Pro$"
}
......@@ -580,35 +660,34 @@ qmp_configure_rescue_ip_device()
elif qmp_is_in "$dev" $(qmp_get_devices mesh) && [ "$dev" != "br-lan" ]
then
# If it is only mesh device
qmp_configure_rescue_ip $dev
qmp_configure_rescue_ip $dev
qmp_attach_device_to_interface $dev $conf $viface
fi
}
qmp_configure_prepare() {
local conf=$1
echo "configuring /etc/config/$conf"
if ! [ -f /etc/config/$conf.orig ]; then
if ! [ -f /etc/config/$conf.orig ]; then
echo "saving original config in: /etc/config/$conf.orig"
cp /etc/config/$conf /etc/config/$conf.orig
fi
uci revert $conf
echo "" > /etc/config/$conf
}
qmp_configure_network() {
local conf="network"
qmp_configure_prepare $conf
echo "-----------------------"
echo "Configuring networking"
echo "-----------------------"
qmp_configure_prepare $conf
if qmp_uci_test qmp.interfaces.mesh_devices && qmp_uci_test qmp.networks.mesh_protocol_vids && qmp_uci_test qmp.networks.mesh_vid_offset; then
local vids="$(uci -q get qmp.networks.mesh_protocol_vids | awk -F':' -v RS=" " '{print $2 + '$(uci -q get qmp.networks.mesh_vid_offset)'}')"
local vids="$(qmp_uci_get networks.mesh_protocol_vids | awk -F':' -v RS=" " '{print $2 + '$(uci -q get qmp.networks.mesh_vid_offset)'}')"
fi
if [[ -n "$vids" ]] && qmp_is_routerstationpro ; then
......@@ -617,7 +696,7 @@ qmp_configure_network() {
elif qmp_uci_test qmp.interfaces.configure_switch ; then
local switch_device="$(uci get qmp.interfaces.configure_switch)"
local switch_device="$(qmp_uci_get interfaces.configure_switch)"
uci set $conf.$switch_device="switch"
uci set $conf.$switch_device.enable="1"
......@@ -634,9 +713,6 @@ qmp_configure_network() {
uci set $conf.wan_ports.device="$switch_device"
uci set $conf.wan_ports.ports="4 5t"
if [[ -n "$vids" ]] ; then
for vid in $vids; do
......@@ -651,7 +727,6 @@ qmp_configure_network() {
done
fi
fi
uci set $conf.loopback="interface"
......@@ -668,13 +743,12 @@ qmp_configure_network() {
uci set $conf.$viface.proto="dhcp"
done
local primary_mesh_device="$(qmp_get_primary_device)"
local community_node_id
local LSB_PRIM_MAC="$(qmp_get_mac_for_dev $primary_mesh_device | awk -F':' '{print $6}' )"
if qmp_uci_test qmp.node.community_node_id; then
community_node_id="$(uci get qmp.node.community_node_id)"
community_node_id="$(qmp_uci_get node.community_node_id)"
elif ! [ -z "$primary_mesh_device" ] ; then
community_node_id=$LSB_PRIM_MAC
fi
......@@ -683,12 +757,12 @@ qmp_configure_network() {
# If it is enabled, apply the non-overlapping DHCP-range preset policy
LAN_MASK="$(uci get qmp.networks.lan_netmask)"
LAN_ADDR="$(uci get qmp.networks.lan_address)"
LAN_MASK="$(qmp_uci_get networks.lan_netmask)"
LAN_ADDR="$(qmp_uci_get networks.lan_address)"
START=2
LIMIT=253
if [ $(uci get qmp.non_overlapping.ignore) -eq 0 ]; then
if [ $(qmp_uci_get non_overlapping.ignore) -eq 0 ]; then
LAN_MASK="255.255.0.0"
# Last byte of lan adress must be "1" to avoid overlappings
LAN_ADDR=$(echo $LAN_ADDR | sed -e 's/\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)\.[0-9]\{1,3\}/\1.1/1')
......@@ -696,14 +770,14 @@ qmp_configure_network() {
OFFSET=0
NUM_GRP=256
UCI_OFFSET="$(uci get qmp.non_overlapping.dhcp_offset)"
UCI_OFFSET="$(qmp_uci_get non_overlapping.dhcp_offset)"
[ $UCI_OFFSET -lt $NUM_GRP ] && OFFSET=$UCI_OFFSET
START=$(( 0x$community_node_id * $NUM_GRP + $OFFSET ))
LIMIT=$(( $NUM_GRP - $OFFSET ))
uci set dhcp.lan.leasetime="$(uci get qmp.non_overlapping.qmp_leasetime)"
uci set dhcp.lan.leasetime="$(qmp_uci_get non_overlapping.qmp_leasetime)"
fi
uci set dhcp.lan.start=$START
......@@ -711,7 +785,7 @@ qmp_configure_network() {
local disable_dhcp=0
if qmp_uci_test qmp.networks.disable_lan_dhcp; then
disable_dhcp="$(uci get qmp.networks.disable_lan_dhcp)"
disable_dhcp="$(qmp_uci_get networks.disable_lan_dhcp)"
fi
if [ "$disable_dhcp" != "1" ]; then
......@@ -730,29 +804,32 @@ qmp_configure_network() {
uci set $conf.lan.proto="static"
uci set $conf.lan.ipaddr=$LAN_ADDR
uci set $conf.lan.netmask=$LAN_MASK
uci set $conf.lan.dns="$(uci get qmp.networks.dns)"
uci set $conf.lan.dns="$(qmp_uci_get networks.dns)"
fi
# MESH DEVICES CONFIGURATION
local counter=1
if uci get qmp.interfaces.mesh_devices && uci get qmp.networks.mesh_protocol_vids && uci get qmp.networks.mesh_vid_offset; then
if qmp_uci_test qmp.interfaces.mesh_devices &&
qmp_uci_test qmp.networks.mesh_protocol_vids &&
qmp_uci_test qmp.networks.mesh_vid_offset; then
for dev in $(qmp_get_devices mesh); do
# If dev is empty, nothing to do
[ -z "$dev" ] || ! qmp_check_device $dev && continue
[ -z "$dev" ] && continue
# Let's configure the mesh device
echo "Configuring "$dev" for Meshing"
# Check if the current device is configured as no-vlan
local use_vlan=1
for no_vlan_int in $(uci get qmp.interfaces.no_vlan_devices 2>/dev/null); do
for no_vlan_int in $(qmp_uci_get interfaces.no_vlan_devices 2>/dev/null); do
[ "$no_vlan_int" == "$dev" ] && use_vlan=0
done
local protocol_vids="$(uci get qmp.networks.mesh_protocol_vids 2>/dev/null)"
local protocol_vids="$(qmp_uci_get qmp.networks.mesh_protocol_vids 2>/dev/null)"
[ -z "$protocol_vids" ] && protocol_vids="olsr6:1 bmx6:2"
for protocol_vid in $protocol_vids; do
......@@ -760,7 +837,7 @@ qmp_configure_network() {
# Calculating the VID offset for VLAN tag
local protocol_name="$(echo $protocol_vid | awk -F':' '{print $1}')"
local vid_suffix="$(echo $protocol_vid | awk -F':' '{print $2}')"
local vid_offset="$(uci get qmp.networks.mesh_vid_offset)"
local vid_offset="$(qmp_uci_get networks.mesh_vid_offset)"
local vid="$(( $vid_offset + $vid_suffix ))"
# virtual interface
......@@ -960,9 +1037,13 @@ qmp_configure_bmx6() {
[ -z "$bmx6_ipv4_netmask" ] && bmx6_ipv4_netmask="32"
uci set $conf.general.tun4Address="$bmx6_ipv4_address/$bmx6_ipv4_netmask"
elif qmp_uci_test qmp.networks.bmx6_ipv4_prefix24 ; then
else
local ipv4_suffix24="$(( 0x$community_node_id % 0x100 ))"
uci set $conf.general.tun4Address="$(uci get qmp.networks.bmx6_ipv4_prefix24).$ipv4_suffix24/32"
local ipv4_prefix24="$(uci get qmp.networks.bmx6_ipv4_prefix24)"
if [ $(echo -n "$ipv4_prefix24" | tr -d [0-9] | wc -c) -lt 2 ]; then
ipv4_prefix24="${ipv4_prefix24}.0"
fi
uci set $conf.general.tun4Address="$ipv4_prefix24.$ipv4_suffix24/32"
fi
counter=$(( $counter + 1 ))
......@@ -1141,12 +1222,19 @@ qmp_configure_system() {
qmp_set_hosts
}
qmp_restart_firewall() {
/etc/init.d/firewall restart
}
qmp_check_force_internet() {
[ "$(uci get qmp.networks.force_internet)" == "1" ] && qmp_gw_offer_default
[ "$(uci get qmp.networks.force_internet)" == "0" ] && qmp_gw_search_default
}
qmp_configure_initial() {
qmp_configure_smart_network
}
qmp_configure() {
qmp_check_force_internet
qmp_configure_network
......
......@@ -19,6 +19,7 @@
# the file called "COPYING".
#
# Contributors:
# Pau Escrich <p4u@dabax.net>
# Sim