summaryrefslogtreecommitdiff
path: root/scripts/internet
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2024-12-05 13:49:22 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2024-12-05 13:49:22 -0500
commitf8d09c5cfd6d1d9595b64547dc9d29c63e40c5f2 (patch)
tree0dd9cfa47cfa0bd4d57d7789439cc86afbbdfa85 /scripts/internet
parent29b1c791f6e319cdab828cee5f491ca1c38e41d1 (diff)
Moved .local/bin to scripts
Diffstat (limited to 'scripts/internet')
-rwxr-xr-xscripts/internet10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/internet b/scripts/internet
new file mode 100755
index 0000000..942eefe
--- /dev/null
+++ b/scripts/internet
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ "$(connmanctl services | grep "Wired" | awk -F' ' '{print $2}')" = "Wired" ] && CONNECTION="Wired" || CONNECTION="$(connmanctl services | grep '*' | awk -F' ' '{print $2}')"
+
+[ "$CONNECTION" = "Wired" ] && IP="$(ip address | grep eth0 | grep 192.168.)" || IP="$(ip address | grep wlo | grep 192.168. )"
+
+IP="${IP%/*}"
+IP="${IP##* }"
+
+echo $CONNECTION $IP