Developing lightweight computation at the DSG edge

Commit 499d6803 authored by p4u's avatar p4u
Browse files

Minor style changes in qmp_functions.sh

parent 8a67a63d
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# the file called "COPYING". # the file called "COPYING".
# #
# Contributors: # Contributors:
# Axel Neumann
# Pau Escrich <p4u@dabax.net> # Pau Escrich <p4u@dabax.net>
# Simó Albert i Beltran # Simó Albert i Beltran
# #
...@@ -654,27 +655,25 @@ qmp_configure_rescue_ip_device() ...@@ -654,27 +655,25 @@ qmp_configure_rescue_ip_device()
} }
qmp_configure_prepare() { qmp_configure_prepare() {
local conf=$1 local conf=$1
echo "-----------------------" if ! [ -f /etc/config/$conf.orig ]; then
echo "Configuring networking"
echo "-----------------------"
if ! [ -f /etc/config/$conf.orig ]; then
echo "saving original config in: /etc/config/$conf.orig" echo "saving original config in: /etc/config/$conf.orig"
cp /etc/config/$conf /etc/config/$conf.orig cp /etc/config/$conf /etc/config/$conf.orig
fi fi
uci revert $conf uci revert $conf
echo "" > /etc/config/$conf echo "" > /etc/config/$conf
} }
qmp_configure_network() { qmp_configure_network() {
local conf="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 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="$(qmp_uci_get 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)'}')"
...@@ -703,9 +702,6 @@ qmp_configure_network() { ...@@ -703,9 +702,6 @@ qmp_configure_network() {
uci set $conf.wan_ports.device="$switch_device" uci set $conf.wan_ports.device="$switch_device"
uci set $conf.wan_ports.ports="4 5t" uci set $conf.wan_ports.ports="4 5t"
if [[ -n "$vids" ]] ; then if [[ -n "$vids" ]] ; then
for vid in $vids; do for vid in $vids; do
...@@ -720,7 +716,6 @@ qmp_configure_network() { ...@@ -720,7 +716,6 @@ qmp_configure_network() {
done done
fi fi
fi fi
uci set $conf.loopback="interface" uci set $conf.loopback="interface"
...@@ -741,7 +736,6 @@ qmp_configure_network() { ...@@ -741,7 +736,6 @@ qmp_configure_network() {
uci set $conf.$viface.proto="dhcp" uci set $conf.$viface.proto="dhcp"
done done
local primary_mesh_device="$(qmp_get_primary_device)" local primary_mesh_device="$(qmp_get_primary_device)"
local community_node_id local community_node_id
local LSB_PRIM_MAC="$(qmp_get_mac_for_dev $primary_mesh_device | awk -F':' '{print $6}' )" local LSB_PRIM_MAC="$(qmp_get_mac_for_dev $primary_mesh_device | awk -F':' '{print $6}' )"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment