We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd29302 commit 09e22d3Copy full SHA for 09e22d3
slib.sh
@@ -443,7 +443,7 @@ setconfig () {
443
# Detect the primary IP address
444
# works across most Linux and FreeBSD (maybe)
445
detect_ip () {
446
- defaultdev=$(ip ro ls|grep default|head -1|awk '{print $5}')
+ defaultdev=$(ip ro ls|grep default|head -1|sed -e 's/.*\sdev\s//g'|awk '{print $1}')
447
primaryaddr=$(ip -f inet addr show dev "$defaultdev" | grep 'inet ' | awk '{print $2}' | head -1 | cut -d"/" -f1 | cut -f1)
448
if [ "$primaryaddr" ]; then
449
log_debug "Primary address detected as $primaryaddr"
0 commit comments