forked from wymiller/nix-config-v2
mod: whitespace
This commit is contained in:
@@ -23,11 +23,13 @@ if [[ ! $route =~ [[:space:]]dev[[:space:]]([^[:space:]]+) ]]; then
|
|||||||
jq -cn '{text: "⚠ Disconnected", class: "disconnected"}'
|
jq -cn '{text: "⚠ Disconnected", class: "disconnected"}'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
interface=${BASH_REMATCH[1]}
|
interface=${BASH_REMATCH[1]}
|
||||||
if [[ ! $route =~ [[:space:]]src[[:space:]]([0-9.]+) ]]; then
|
if [[ ! $route =~ [[:space:]]src[[:space:]]([0-9.]+) ]]; then
|
||||||
jq -cn '{text: "⚠ Disconnected", class: "disconnected"}'
|
jq -cn '{text: "⚠ Disconnected", class: "disconnected"}'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local_ip=${BASH_REMATCH[1]}
|
local_ip=${BASH_REMATCH[1]}
|
||||||
|
|
||||||
if [[ -s $state_file ]]; then
|
if [[ -s $state_file ]]; then
|
||||||
@@ -48,4 +50,5 @@ if [[ $(nmcli -g GENERAL.TYPE device show "$interface" 2>/dev/null) == wifi ]];
|
|||||||
else
|
else
|
||||||
text=" $local_ip"
|
text=" $local_ip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jq -cn --arg text "$text" '{text: $text, class: "connected"}'
|
jq -cn --arg text "$text" '{text: $text, class: "connected"}'
|
||||||
|
|||||||
Reference in New Issue
Block a user