From 071e4c910e5478d6d259c4ffdd6f2a552e12a085 Mon Sep 17 00:00:00 2001 From: Duncan Gibson Date: Sat, 22 Jul 2023 10:03:06 -0400 Subject: [PATCH 1/3] let's try this? --- tailscale.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tailscale.sh b/tailscale.sh index d86d66e..7762dd9 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -75,20 +75,21 @@ echo "done." echo "Starting services..." -if systemctl is-enabled --quiet systemd-sysext && systemctl is-active --quiet systemd-sysext; then - echo "systemd-sysext is already enabled and active" +systemctl enable systemd-sysext +systemctl restart systemd-sysext + +systemd-sysext refresh +systemctl daemon-reload + +systemctl enable tailscaled + +if systemctl is-active --quiet tailscaled; then + echo "Upgrade complete. Restarting tailscaled..." else - systemctl enable systemd-sysext --now + echo "Install complete. Starting tailscaled..." fi -systemd-sysext refresh > /dev/null 2>&1 -systemctl daemon-reload > /dev/null +# This needs to be the last thing we do in case the user's running this over Tailscale SSH. +systemctl restart tailscaled -if systemctl is-enabled --quiet tailscaled && systemctl is-active --quiet tailscaled; then - echo "tailscaled is already enabled and active; restarting it..." - systemctl restart tailscaled -else - systemctl enable tailscaled --now -fi - -echo "Tailscale installed and ready." +echo "Done." From 8b832a32e392b4fd8a20cb100d07de25290c9094 Mon Sep 17 00:00:00 2001 From: Duncan Gibson Date: Sat, 22 Jul 2023 10:10:27 -0400 Subject: [PATCH 2/3] well, that didn't work. damn you, systemd-sysext --- tailscale.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tailscale.sh b/tailscale.sh index 7762dd9..67e6b86 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -75,8 +75,11 @@ echo "done." echo "Starting services..." -systemctl enable systemd-sysext -systemctl restart systemd-sysext +if systemctl is-enabled --quiet systemd-sysext && systemctl is-active --quiet systemd-sysext; then + echo "systemd-sysext is already enabled and active" +else + systemctl enable systemd-sysext --now +fi systemd-sysext refresh systemctl daemon-reload From 21ee55924ef0ac821a34925583f7ebf0136b8be3 Mon Sep 17 00:00:00 2001 From: Duncan Gibson Date: Sat, 22 Jul 2023 10:37:15 -0400 Subject: [PATCH 3/3] comments and cleanup --- tailscale.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tailscale.sh b/tailscale.sh index 67e6b86..beafdd7 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -73,26 +73,25 @@ fi echo "done." -echo "Starting services..." +echo "Starting required services..." +# systemd-sysext - manages system extensions if systemctl is-enabled --quiet systemd-sysext && systemctl is-active --quiet systemd-sysext; then echo "systemd-sysext is already enabled and active" else - systemctl enable systemd-sysext --now + systemctl enable systemd-sysext --now # this should be all we need in every case, but something breaks if it's already enabled/running. fi +systemd-sysext refresh > /dev/null 2>&1 -systemd-sysext refresh -systemctl daemon-reload +echo "Done." +# tailscaled - the tailscale daemon systemctl enable tailscaled - if systemctl is-active --quiet tailscaled; then echo "Upgrade complete. Restarting tailscaled..." else echo "Install complete. Starting tailscaled..." fi - -# This needs to be the last thing we do in case the user's running this over Tailscale SSH. -systemctl restart tailscaled +systemctl restart tailscaled # This needs to be the last thing we do in case the user's running this over Tailscale SSH. echo "Done."