-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Raindrac
committed
Jul 2, 2024
1 parent
5245c9f
commit 08154d8
Showing
1 changed file
with
38 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |