From 9c629a125fd15082c1b61aaa85e5cdd1649244d9 Mon Sep 17 00:00:00 2001 From: Markus Storm Date: Thu, 24 Aug 2023 15:39:40 +0200 Subject: [PATCH] reset_tailscale_auth() Signed-off-by: Markus Storm --- functions/vpn.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/functions/vpn.bash b/functions/vpn.bash index b70d7663b..74f4bac9a 100644 --- a/functions/vpn.bash +++ b/functions/vpn.bash @@ -230,6 +230,9 @@ install_tailscale() { ## ## setup_tailscale(String action) ## +## argument 1 is tailscape key +## argument 2 is tailscale tags +## setup_tailscale() { local preAuthKey="${1:-${preauthkey}}" local tags="${2:-${tstags}}" @@ -255,3 +258,19 @@ setup_tailscale() { return 0 } + + +## reset tailscale VPN auth with new key +## +## reset_tailscale_auth(String tskey, tags) +## +## argument 1 is tailscape key +## argument 2 is tailscale tags +## +reset_tailscale_auth() { + local preAuthKey="${1:-${preauthkey}}" + local tags="${2:-${tstags}}" + + tailscale up --reset --authkey "${preAuthKey}" --advertise-tags="${tags}" +} +