# -*-Shell-script-*-
+# $Id$
+# $URL$
#
# Common functions for PLC startup/shutdown scripts
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id$
-#
export PATH=/sbin:/bin:/usr/bin:/usr/sbin
# 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