diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2023-01-04 18:37:40 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2023-01-04 18:37:40 -0500 |
| commit | 6e11f434d71a49a6f3dd42d1471eaf7b46003717 (patch) | |
| tree | 74cbff4ee50f947901b7afd7c38ff04c1dc61e66 /.local/bin/internet | |
| parent | b9e00afded90f03ac18f75aa7dfc8e7f3e146348 (diff) | |
updating scripts
Diffstat (limited to '.local/bin/internet')
| -rwxr-xr-x | .local/bin/internet | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.local/bin/internet b/.local/bin/internet new file mode 100755 index 0000000..70e48ec --- /dev/null +++ b/.local/bin/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 dynamic | grep 192.168.)" || IP="$(ip address | grep wlo | grep 192.168. )" + +IP="${IP%/*}" +IP="${IP##* }" + +printf $CONNECTION |
