summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-11-29 15:33:40 -0600
committerCraig Jennings <c@cjennings.net>2024-11-29 15:33:40 -0600
commit8a57063b8c3e6a65858298a8eaa7970b324d9f3b (patch)
treea2f2d9137e84e7c7620899e723d97d6a01ac83cb
parent5daddeb0848a1e3f3dfc607b111fdc6cc52186fa (diff)
skipping the loopback interface
-rwxr-xr-xinit2
1 files changed, 1 insertions, 1 deletions
diff --git a/init b/init
index bf22cd3..d7ccb78 100755
--- a/init
+++ b/init
@@ -11,7 +11,7 @@ echo "root:welcome" | chpasswd
hostname=$(</etc/hostname)
# identify which interface is up, then find the ip address
-interface_up=$(ip addr show | grep "state UP" -B2 | head -n1 | awk '{print $2}' | sed 's/://')
+interface_up=$(ip addr show | grep -v "lo: " | grep "state UP" -B2 | head -n1 | awk '{print $2}' | sed 's/://')
ipaddress=$(ip addr show $(interface_up) | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
# start the ssh daemon