mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-12 08:00:08 +01:00
feat: update linux network ssid fetch
This commit is contained in:
parent
d2491d15a3
commit
3837498239
1 changed files with 31 additions and 33 deletions
|
|
@ -4,12 +4,11 @@ export LC_ALL=en_US.UTF-8
|
||||||
|
|
||||||
HOSTS="google.com github.com example.com"
|
HOSTS="google.com github.com example.com"
|
||||||
|
|
||||||
get_ssid()
|
get_ssid() {
|
||||||
{
|
|
||||||
# Check OS
|
# Check OS
|
||||||
case $(uname -s) in
|
case $(uname -s) in
|
||||||
Linux)
|
Linux)
|
||||||
SSID=$(iw dev | sed -nr 's/^\t\tssid (.*)/\1/p')
|
SSID=$(iwgetid -r)
|
||||||
if [ -n "$SSID" ]; then
|
if [ -n "$SSID" ]; then
|
||||||
printf '%s' " $SSID"
|
printf '%s' " $SSID"
|
||||||
else
|
else
|
||||||
|
|
@ -29,14 +28,13 @@ get_ssid()
|
||||||
# leaving empty - TODO - windows compatability
|
# leaving empty - TODO - windows compatability
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*) ;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main() {
|
||||||
{
|
|
||||||
network="Offline"
|
network="Offline"
|
||||||
for host in $HOSTS; do
|
for host in $HOSTS; do
|
||||||
if ping -q -c 1 -W 1 "$host" &>/dev/null; then
|
if ping -q -c 1 -W 1 "$host" &>/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue