From: Thierry Parmentelat Date: Thu, 27 Feb 2020 14:47:17 +0000 (+0100) Subject: gethostbyname written in python3 X-Git-Tag: myplc-7.1-0~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=9d4e6986eb8adc75a34a8acc8fe0700764117c7f;p=myplc.git gethostbyname written in python3 --- diff --git a/plc.d/functions b/plc.d/functions index 340e89d..fa44a5c 100644 --- a/plc.d/functions +++ b/plc.d/functions @@ -83,7 +83,8 @@ function plc_daemon () { # Print IP address of hostname if resolvable function gethostbyname () { - python -c 'import socket; import sys; print socket.gethostbyname(sys.argv[1])' $1 2>/dev/null + local host="$1"; shift + python3 -c "import socket; import sys; print(socket.gethostbyname('${host}'))" } # Forcefully make a symlink