[plug] getting IP address in a shell script

Craig Ringer craig at postnewspapers.com.au
Tue Jul 30 18:48:50 WST 2002


> variable=`hostname -i`

craig$ hostname -i
127.0.0.1

not quite it, I think. Perhaps if /etc/hosts is done with the hostname 
on a real IP, but this won't work out if the system is on DHCP.

-- 
Craig Ringer
GPG Key Fingerprint: AF1C ABFE 7E64 E9C8 FC27  C16E D3CE CDC0 0E93 380D
	-- if it ain't broke, add features 'till it is. (or:)
	while (! broken) { features ++ ; broken = isBroken(features) }




More information about the plug mailing list