Developing lightweight computation at the DSG edge

Commit 3fa358b6 authored by p4u's avatar p4u
Browse files

Added condition to qmp_set_host to do not rewrite hosts file if the entry already exists

parent a769cbf2
......@@ -793,9 +793,11 @@ qmp_set_hosts() {
if [ $(cat /etc/hosts | grep qmpadmin | grep "^$ip" -c) -eq 0 ]; then
cat /etc/hosts | grep -v qmpadmin > /tmp/hosts.tmp
echo "$ip $hn admin.qmp qmpadmin" >> /tmp/hosts.tmp
cp /tmp/hosts.tmp /etc/hosts
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