Developing lightweight computation at the DSG edge

Commit 9012d2b0 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

sed -i -e 's/\s\+$//g' packages/qmp-small-node/files/etc/qmp/qmp_network.sh

parent 1da0a2b3
......@@ -56,8 +56,8 @@ qmp_publish_lan() {
echo "Publishing LAN network: $lan_netid/$lan_prefix"
qmp_publish_hna_bmx6 $lan_netid/$lan_prefix qMp_lan
else
qmp_unpublish_hna_bmx6 qMp_lan
fi
qmp_unpublish_hna_bmx6 qMp_lan
fi
}
# Usage: qmp_publish_hna_bmx6_ipv4 10.22.33.64/27 [name_id]
......@@ -71,10 +71,10 @@ qmp_publish_hna_bmx6() {
is_ipv6=$(echo $netid | grep : -c)
is_ipv4=$(echo $netid | grep . -c)
[ $is_ipv6 -eq $is_ipv4 ] && { echo "Error in IP format"; return; }
[ $is_ipv6 -eq $is_ipv4 ] && { echo "Error in IP format"; return; }
# if not name_id provided, getting one from netid md5sum
[ -z "$name_id" ] && name_id="$(echo $netid | md5sum | cut -c1-5)"
[ -z "$name_id" ] && name_id="$(echo $netid | md5sum | cut -c1-5)"
if [ $is_ipv4 ]; then
# Checking if netmask is in ipv4 format and converting it to ipv6
......@@ -83,17 +83,17 @@ qmp_publish_hna_bmx6() {
else
hna="$netid/$netmask"
fi
uci set bmx6.$name_id=hna
uci set bmx6.$name_id.hna="$hna"
uci commit
bmx6 -c --test -a $hna > /dev/null
if [ $? -eq 0 ]; then
if [ $? -eq 0 ]; then
bmx6 -c --configReload
else
echo "ERROR in bmx6, check log"
echo "ERROR in bmx6, check log"
fi
}
......
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