Developing lightweight computation at the DSG edge

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

Remove unneeded grep in qmp_set_hosts function of qmp_functions.sh to optimize.

parent 4ff5a86f
......@@ -832,7 +832,7 @@ qmp_set_hosts() {
return
fi
if [ $(cat /etc/hosts | grep qmpadmin | grep "^$ip" -c) -eq 0 ]; then
if [ $(cat /etc/hosts | grep -c "^$ip.*qmpadmin") -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
......
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