# Print IP address of hostname if resolvable
gethostbyname ()
{
- perl -MSocket -e '($a,$b,$c,$d,@addrs) = gethostbyname($ARGV[0]); print inet_ntoa($addrs[0]) . "\n";' $1 2>/dev/null
+ python -c 'import socket; import sys; print socket.gethostbyname(sys.argv[1])' $1 2>/dev/null
}
# Forcefully make a symlink
# Make copies of stdout and stderr. The plc initscript redirects
# stdout and stderr to a logfile if -v is not specified.
-[ ! -e /dev/fd/3 ] && exec 3>&1
-[ ! -e /dev/fd/4 ] && exec 4>&2
+[ ! -e /proc/self/fd/3 ] && exec 3>&1
+[ ! -e /proc/self/fd/4 ] && exec 4>&2