This commit is contained in:
David Aizenberg
2025-12-03 00:05:20 +01:00
parent 35a0b4ef93
commit 66b9a60139
3 changed files with 12 additions and 6 deletions

View File

@@ -127,6 +127,7 @@ def build_menu():
lines.append(" ● Exit Node Active - Disconnect")
for node in get_ts_exit_nodes():
lines.append(f" ○ {node['hostname']} ({node['country']}/{node['city']})")
lines.append(" ⊘ Tailscale Down")
else:
lines.append(" ○ Start Tailscale")
@@ -205,6 +206,11 @@ def handle_selection(selection):
notify("Tailscale started")
return
if clean == "Tailscale Down":
run(["tailscale", "down"])
notify("Tailscale stopped")
return
for node in ts_exit_nodes:
if node["hostname"] in clean or node["short"] in clean:
disconnect_all_wg()

View File

@@ -43,7 +43,7 @@ get_status() {
fi
# Check Tailscale
if command -v tailscale &>/dev/null; then
if command -v tailscale &>/dev/null && tailscale status &>/dev/null; then
ts_json=$(tailscale status --json 2>/dev/null)
if [[ -n "$ts_json" ]]; then
ts_state=$(echo "$ts_json" | jq -r '.BackendState // empty')