summaryrefslogtreecommitdiff
path: root/.local/bin/internet
blob: 70e48ec1d9afc399fa9c446067400516473f5a31 (plain)
1
2
3
4
5
6
7
8
9
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