summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-11-29 15:38:32 -0600
committerCraig Jennings <c@cjennings.net>2024-11-29 15:38:32 -0600
commit38c8eb12770eb964505e5e3183b98f3ec8a2c3de (patch)
treec43e10a9f631f480b4e9ca6b597515b06fcda6ec
parent1a5d951707aff693fa97816e64fc56a77cdabfb1 (diff)
attempt 3
-rwxr-xr-xinit5
1 files changed, 4 insertions, 1 deletions
diff --git a/init b/init
index 47ab988..851ca0f 100755
--- a/init
+++ b/init
@@ -11,7 +11,10 @@ echo "root:welcome" | chpasswd
hostname=$(</etc/hostname)
# identify which interface is up, then find the ip address
-interface_up=$(ip addr show | grep -v "lo: " | 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)
+
+interface_up=$(ip -br addr show | grep UP | grep -v 'lo' | awk '{print $1}' | head -n1)
ipaddress=$(ip addr show $interface_up | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
# start the ssh daemon