git://git.onelab.eu
/
myplc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8692cd
)
gethostbyname written in python3
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 27 Feb 2020 14:47:17 +0000
(15:47 +0100)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 27 Feb 2020 14:47:17 +0000
(15:47 +0100)
plc.d/functions
patch
|
blob
|
history
diff --git
a/plc.d/functions
b/plc.d/functions
index
340e89d
..
fa44a5c
100644
(file)
--- 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