test
This commit is contained in:
parent
7ef93416fa
commit
0da2872a34
1 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
||||||
text = ''
|
text = ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
CLASS=`tailscale status --json | jq -r '.BackendState'`
|
CLASS=`tailscale status --json | jq -r '.BackendState'`
|
||||||
|
TEXT=""
|
||||||
# Known values: Running, Stopped
|
# Known values: Running, Stopped
|
||||||
|
|
||||||
# Expected Output:
|
# Expected Output:
|
||||||
|
@ -14,11 +15,11 @@
|
||||||
if [ $CLASS == "Running" ]; then
|
if [ $CLASS == "Running" ]; then
|
||||||
IP=`tailscale status --json | jq -r '.TailscaleIPs[0]'`
|
IP=`tailscale status --json | jq -r '.TailscaleIPs[0]'`
|
||||||
ALT="IP: $IP"
|
ALT="IP: $IP"
|
||||||
printf '{"class": %s", "alt": %s}' "$CLASS", "$ALT"
|
printf '{"text": %s,"class": %s", "alt": %s}\n' "$TEXT" "$CLASS" "$ALT"
|
||||||
fi
|
fi
|
||||||
if [ $CLASS == "Stopped" ]; then
|
if [ $CLASS == "Stopped" ]; then
|
||||||
ALT="Tailscale is not running"
|
ALT="Tailscale is not running"
|
||||||
printf '{"class": %s", "alt": %s}' "$CLASS", "$ALT"
|
printf '{"text": %s,"class": %s", "alt": %s}\n' "$TEXT" "$CLASS" "$ALT"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue