mirror of
https://github.com/PurpleComputing/Tailscale-scripts.git
synced 2026-02-03 05:53:23 +00:00
tstools.sh
This commit is contained in:
26
Mac/check-version.sh → Mac/tstools.sh
Executable file → Normal file
26
Mac/check-version.sh → Mac/tstools.sh
Executable file → Normal file
@@ -22,10 +22,33 @@
|
||||
# check-version.sh SCMvab2e744
|
||||
# Last Updated by Purple, 05/02/2025
|
||||
####################################################################################################
|
||||
#echo "*** BEGIN check-version.sh ***"
|
||||
SYMLINK="/usr/local/bin/tstools"
|
||||
TARGET="/opt/PurpleComputing/tstools.sh"
|
||||
DA=$(date +%s)
|
||||
curl -s -o /tmp/tailscale-$DA.sh -L https://prpl.uk/tailscalesh
|
||||
curl -s -o $TARGET -L https://prpl.uk/tailscaletools
|
||||
source /tmp/tailscale-$DA.sh
|
||||
|
||||
|
||||
|
||||
# Check if the symlink exists and is valid
|
||||
if [ -L "$SYMLINK" ] && [ "$(readlink "$SYMLINK")" == "$TARGET" ]; then
|
||||
echo ""
|
||||
else
|
||||
# Remove any existing file or incorrect symlink
|
||||
if [ -e "$SYMLINK" ] || [ -L "$SYMLINK" ]; then
|
||||
rm -f "$SYMLINK"
|
||||
fi
|
||||
|
||||
ln -s "$TARGET" "$SYMLINK"
|
||||
|
||||
# Verify the creation
|
||||
if [ -L "$SYMLINK" ]; then
|
||||
echo ""
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
####################################################################################################
|
||||
|
||||
$@
|
||||
@@ -34,4 +57,3 @@ $@
|
||||
|
||||
rm /tmp/tailscale-$DA.sh
|
||||
echo ""
|
||||
#echo "*** END check-version.sh ***"
|
||||
Reference in New Issue
Block a user