Developing lightweight computation at the DSG edge

Commit c3a3af82 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_functions.sh

parent 1f4487ac
...@@ -786,17 +786,17 @@ qmp_set_hosts() { ...@@ -786,17 +786,17 @@ qmp_set_hosts() {
local ip=$(uci get bmx6.general.tun4Address | cut -d'/' -f1) local ip=$(uci get bmx6.general.tun4Address | cut -d'/' -f1)
local hn=$(uci get system.@system[0].hostname) local hn=$(uci get system.@system[0].hostname)
if [ -z "$ip" -o -z "$hn" ]; then if [ -z "$ip" -o -z "$hn" ]; then
echo "Cannot get IP or HostName" echo "Cannot get IP or HostName"
return return
fi fi
if [ $(cat /etc/hosts | grep qmpadmin | grep "^$ip" -c) -eq 0 ]; then if [ $(cat /etc/hosts | grep qmpadmin | grep "^$ip" -c) -eq 0 ]; then
cat /etc/hosts | grep -v qmpadmin > /tmp/hosts.tmp cat /etc/hosts | grep -v qmpadmin > /tmp/hosts.tmp
echo "$ip $hn admin.qmp qmpadmin" >> /tmp/hosts.tmp echo "$ip $hn admin.qmp qmpadmin" >> /tmp/hosts.tmp
cp /tmp/hosts.tmp /etc/hosts cp /tmp/hosts.tmp /etc/hosts
fi fi
echo "done" echo "done"
} }
......
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