From 67fb304c8af60f616759db2198581ad549844dcc Mon Sep 17 00:00:00 2001 From: Purple Date: Wed, 5 Feb 2025 17:42:59 +0000 Subject: [PATCH] tstools.sh --- Mac/{check-version.sh => tstools.sh} | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) rename Mac/{check-version.sh => tstools.sh} (79%) mode change 100755 => 100644 diff --git a/Mac/check-version.sh b/Mac/tstools.sh old mode 100755 new mode 100644 similarity index 79% rename from Mac/check-version.sh rename to Mac/tstools.sh index 0f42f93..b758132 --- a/Mac/check-version.sh +++ b/Mac/tstools.sh @@ -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 ***" \ No newline at end of file