Developing lightweight computation at the DSG edge

Commit 54da6614 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Restart bmx6 if hostname is changed. Closes #272.

parent 517f7cea
......@@ -59,7 +59,7 @@ apply_netserver() {
configure_network() {
qmp_configure
[ -f "/etc/init.d/olsrd" ] && /etc/init.d/olsrd restart
bmx6 -c --configReload || /etc/init.d/bmx6 restart
qmp_bmx6_reload
/etc/init.d/network reload
/etc/init.d/dnsmasq restart
apply_netserver
......
......@@ -263,3 +263,26 @@ qmp_configure_lan_v6() {
echo "Done"
}
qmp_bmx6_reload() {
local restart_bmx6=false
local bmx6_name="$(bmx6 -c status | awk 'END{split($4,f,"."); print f[1]}')"
local current_hostname="$(cat /proc/sys/kernel/hostname)"
if [ "$current_hostname" != "$bmx6_name" ]
then
restart_bmx6=true
fi
if ! $restart_bmx6
then
if ! bmx6 -c --configReload
then
restart_bmx6=true
fi
fi
if $restart_bmx6
then
/etc/init.d/bmx6 restart
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