ud
This commit is contained in:
13
directadmin-1.62.4/scripts/get_main_ip.sh
Normal file
13
directadmin-1.62.4/scripts/get_main_ip.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
#Script to return the main useable device IP address of the box, used for main outbound connections.
|
||||
#on a LAN, this should match your directadmin.conf lan_ip setting.
|
||||
#for normal servers, this will likely return your license IP (usually)
|
||||
#Will also be the default IP that exim sends email through.
|
||||
OS=`uname`
|
||||
if [ "${OS}" = "FreeBSD" ]; then
|
||||
/sbin/ifconfig | grep inet | grep -m1 broadcast | awk '{ print $2; }'
|
||||
else
|
||||
/sbin/ip a | grep inet | grep -m1 brd | awk '{ print $2; };' | cut -d/ -f1
|
||||
fi
|
||||
RET=$?
|
||||
exit $RET
|
||||
Reference in New Issue
Block a user