add small helper if it is the users first time running the script

This commit is contained in:
Zac Holland
2023-12-18 13:11:22 -08:00
parent f582ec51e7
commit 8b128cf1e9

View File

@@ -72,6 +72,7 @@ cp -rf $tar_dir/tailscaled /opt/tailscale/tailscaled
# add binaries to path via profile.d # add binaries to path via profile.d
if ! test -f /etc/profile.d/tailscale.sh; then if ! test -f /etc/profile.d/tailscale.sh; then
echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
source /etc/profile.d/tailscale.sh
fi fi
# copy the systemd file into place # copy the systemd file into place
@@ -109,3 +110,11 @@ fi
systemctl restart tailscaled &>/dev/null || echo "ERROR: Could not start tailscaled service" systemctl restart tailscaled &>/dev/null || echo "ERROR: Could not start tailscaled service"
echo "done." echo "done."
if ! command -v tailscale &> /dev/null; then
echo "Tailscale is installed and running but the binaries are not in your path yet."
echo "Restart your session or run the following command to add them:"
echo "" && echo "source /etc/tailscale" && echo ""
fi
echo "Installation Complete."