Developing lightweight computation at the DSG edge

Commit 03855c65 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Restart bmx6 if hostname is changed with configure_system. Closes #273.

parent 517f7cea
......@@ -67,6 +67,7 @@ configure_network() {
configure_system() {
qmp_configure_system
qmp_bmx6_reload
/etc/init.d/uhttpd restart
}
......
......@@ -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