Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix toggle-tailscale just command on aurora #1621

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ toggle-tailscale:
#!/bin/bash
set -euo pipefail
source /usr/lib/ujust/ujust.sh
source /usr/lib/os-release

TAILSCALED_STATUS="$(systemctl is-enabled tailscaled || true )"

Expand All @@ -301,22 +302,31 @@ toggle-tailscale:
echo "tailscaled service status: $TAILSCALED_STATUS"
fi

TAILSCALE_QS="$(gnome-extensions list | grep -q "tailscale@joaophi.github.com"; echo $?)"
if [ "$TAILSCALE_QS" == 0 ]; then
TAILSCALE_QS="Installed"
else
echo "The Tailscale QS extension for Gnome is not installed. Please install it and then run this script again."
fi

if [ "$TAILSCALE_QS" == "Installed" ] && [ "$TAILSCALED" == "Installed" ]; then
if [ "$TAILSCALED" == "Installed" ]; then
echo "Enable or disable Tailscale?"
TS_OPTION=$(ugum choose Enable Disable)

# gnome-extensions is only available on Bluefin (Gnome)
if [ "$VARIANT" == "silverblue" ]; then
TAILSCALE_QS="$(gnome-extensions list | grep -q "tailscale@joaophi.github.com"; echo $?)"
if [ "$TAILSCALE_QS" == 0 ]; then
TAILSCALE_QS="Installed"
else
echo "The Tailscale QS extension for Gnome is not installed. Please install it and then run this script again."
fi

if [ "$TS_OPTION" = "Enable" ]; then
gnome-extensions enable tailscale@joaophi.github.com
elif [ "$TS_OPTION" = "Disable" ]; then
gnome-extensions disable tailscale@joaophi.github.com
fi
fi

if [ "$TS_OPTION" = "Enable" ]; then
systemctl enable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled || true )"
if [ "$TAILSCALED_STATUS" == "enabled" ]; then
gnome-extensions enable tailscale@joaophi.github.com
echo "${b}${green}Tailscale is enabled.${n}"
echo "If this is your first time using Tailscale, setup is necessary."
echo "Refer to Tailscale's documentation at https://tailscale.com/kb/1346/start."
Expand All @@ -325,7 +335,6 @@ toggle-tailscale:
systemctl disable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled || true )"
if [ "$TAILSCALED_STATUS" == "disabled" ]; then
gnome-extensions disable tailscale@joaophi.github.com
echo "${b}${red}Tailscale is disabled.${n}"
fi
fi
Expand Down
Loading