From ffd98e3780479b45921b542e27c73da5e485a7f8 Mon Sep 17 00:00:00 2001 From: Carlos Chulo <9343504+cchulo@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:42:11 -0700 Subject: [PATCH] Fixes error with enabling systemd-sysext a second time --- tailscale.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tailscale.sh b/tailscale.sh index 4640c3f..e2612d3 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -53,12 +53,20 @@ cp -rf tailscale /var/lib/extensions/ popd > /dev/null rm -rf "${dir}" -systemctl enable systemd-sysext --now +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 > /dev/null 2>&1 systemctl daemon-reload > /dev/null -systemctl enable tailscaled --now +if systemctl is-enabled --quiet systemd-sysext && systemctl is-active --quiet systemd-sysext; then + echo "tailscaled is already active" +else + systemctl enable tailscaled --now +fi echo "done." -echo "If updating, reboot or run the following to finish the process: sudo systemctl restart tailscaled" \ No newline at end of file +echo "If updating, reboot or run the following to finish the process: sudo systemctl restart tailscaled"