mirror of
https://github.com/PurpleComputing/Tailscale-scripts.git
synced 2026-03-07 18:32:04 +00:00
61 lines
2.4 KiB
Bash
Executable File
61 lines
2.4 KiB
Bash
Executable File
#!/bin/zsh
|
|
####################################################################################################
|
|
#
|
|
# ******
|
|
# *...../ / ******
|
|
# ************** *****/ *****/*****/***/*************/ ****** /**********
|
|
# ******/..*****/ *****/ *****/********//******/ ,*****/******,***** ,*****/
|
|
# *****/ ***** *****/ *****/*****/ *****/ /**************************
|
|
# *******//*****/ *************/*****/ *********************/*******./*/* ())
|
|
# ************* ******/*****/*****/ *****/******/. ****** ********** (()))
|
|
# *****/ *****/ ())
|
|
# *****/ *****/
|
|
#
|
|
# ATTENTION - DISCLAIMER
|
|
# YOU USE THIS SCRIPT AT YOUR OWN RISK. THE SCRIPT IS PROVIDED FOR USE “AS IS” WITHOUT WARRANTY OF
|
|
# ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW PURPLE COMPUTING DISCLAIMS ALL WARRANTIES OF ANY
|
|
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OR CONDITIONS
|
|
# OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. PURPLE COMPUTING CANNOT
|
|
# BE HELD LIABLE FOR DAMAGES CAUSED BY THE EXECUTION OF THIS CODE.
|
|
#
|
|
####################################################################################################
|
|
# tstools.sh - Must be run with Sudo or MDM
|
|
# Last Updated by Purple, 05/02/2025
|
|
####################################################################################################
|
|
SYMLINK="/usr/local/bin/tstools"
|
|
TARGET="/opt/PurpleComputing/tstools.sh"
|
|
mkdir -p /opt/PurpleComputing/
|
|
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
|
|
####################################################################################################
|
|
|
|
$@
|
|
|
|
####################################################################################################
|
|
|
|
rm /tmp/tailscale-$DA.sh
|
|
echo ""
|