Skip to content

Commit

Permalink
style: Added indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Raindrac committed Jul 2, 2024
1 parent 5245c9f commit 08154d8
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -283,46 +283,46 @@ update-ng:

# Toggle tailscale
toggle-tailscale:
#!/bin/bash
source /usr/lib/ujust/ujust.sh

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

if [ "$TAILSCALED_STATUS" == "enabled" ]; then
TAILSCALED="Installed"
elif [ "$TAILSCALED_STATUS" == "disabled" ]; then
TAILSCALED="Installed"
else
echo "${b}${red}Unable to enable or disable Tailscale.${n}"
echo "tailscaled service status: $TAILSCALED_STATUS"
fi

TAILSCALE_QS="$(gnome-extensions list | grep -q "tailscale"; 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 use this command again."
fi

if [ "$TAILSCALE_QS" == "Installed" ] && [ "$TAILSCALED" == "Installed" ]; then
echo "Enable or disable Tailscale?"
TS_OPTION=$(gum choose Enable Disable)
#!/bin/bash
source /usr/lib/ujust/ujust.sh

if [ "$TS_OPTION" = "Enable" ]; then
systemctl enable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled)"

if [ "$TAILSCALED_STATUS" == "enabled" ]; then
gnome-extensions enable [email protected]
echo "${b}${green}Enabled Tailscale.${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."
TAILSCALED="Installed"
elif [ "$TAILSCALED_STATUS" == "disabled" ]; then
TAILSCALED="Installed"
else
echo "${b}${red}Unable to enable or disable Tailscale.${n}"
echo "tailscaled service status: $TAILSCALED_STATUS"
fi
elif [ "$TS_OPTION" = "Disable" ]; then
systemctl disable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled)"
if [ "$TAILSCALED_STATUS" == "disabled" ]; then
gnome-extensions disable [email protected]
echo "${b}${red}Disabled Tailscale.${n}"

TAILSCALE_QS="$(gnome-extensions list | grep -q "tailscale"; 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 use this command again."
fi
fi
fi

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

if [ "$TS_OPTION" = "Enable" ]; then
systemctl enable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled)"
if [ "$TAILSCALED_STATUS" == "enabled" ]; then
gnome-extensions enable [email protected]
echo "${b}${green}Enabled Tailscale.${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."
fi
elif [ "$TS_OPTION" = "Disable" ]; then
systemctl disable --now tailscaled
TAILSCALED_STATUS="$(systemctl is-enabled tailscaled)"
if [ "$TAILSCALED_STATUS" == "disabled" ]; then
gnome-extensions disable [email protected]
echo "${b}${red}Disabled Tailscale.${n}"
fi
fi
fi

0 comments on commit 08154d8

Please sign in to comment.