From f8d09c5cfd6d1d9595b64547dc9d29c63e40c5f2 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Thu, 5 Dec 2024 13:49:22 -0500 Subject: Moved .local/bin to scripts --- scripts/internet | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/internet (limited to 'scripts/internet') 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 -- cgit v1.2.3