From 9d4e6986eb8adc75a34a8acc8fe0700764117c7f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 27 Feb 2020 15:47:17 +0100 Subject: [PATCH] gethostbyname written in python3 --- plc.d/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.0