diff --git a/30-add-host-ip-entry.sh b/30-add-host-ip-entry.sh index b5b462e40ed4475c147f1c64d9ed13eaf5bca1a0..206548fb40681318c9bcced9f7ed1af85adf2b8e 100755 --- a/30-add-host-ip-entry.sh +++ b/30-add-host-ip-entry.sh @@ -2,8 +2,8 @@ if [ "$EUID" -ne 0 ] then HOST_IP=$(sudo /sbin/ip route|awk '/default/ { print $3 }') - echo "$HOST_IP host.docker.internal" >> /etc/hosts + sudo -s "echo '$HOST_IP host.docker.internal' >> /etc/hosts" else HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - sudo -s "echo '$HOST_IP host.docker.internal' >> /etc/hosts" + echo "$HOST_IP host.docker.internal" >> /etc/hosts fi