From 806a78e8d31f630f56f9b43f6f8b999380809246 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Wed, 7 May 2025 17:17:37 -0700 Subject: [PATCH] nusht --- users/tao/nushell/extras/tailscale.nu | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/users/tao/nushell/extras/tailscale.nu b/users/tao/nushell/extras/tailscale.nu index b421777..f232d4d 100644 --- a/users/tao/nushell/extras/tailscale.nu +++ b/users/tao/nushell/extras/tailscale.nu @@ -15,14 +15,17 @@ def check-mullvad [] { # switch to a specific exit node, or none def tse [exit_node: string = ""] { if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) { - return "stop summoning first!" - } else { - tailscale set --exit-node $exit_node + print "stop summoning first!" + return false } + + tailscale set --exit-node $exit_node + if ($exit_node | is-not-empty) { - check-mullvad | return $in + return check-mullvad() } else { - return "exit node set" + print "exit node set" + return true } }