diff --git a/Task_scripts/Linux - Schedule agent update.sh b/Task_scripts/Linux - Schedule agent update.sh new file mode 100644 index 0000000..e4903e6 --- /dev/null +++ b/Task_scripts/Linux - Schedule agent update.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# GitHub script URL +GITHUB_URL="https://gittea.dannydekooker.nl/Dcomputers/TacticalRMM_Scripts/raw/branch/main/Supporting_scripts/Linux%20-%20Update%20TRMM%20agent.sh" + +# Destination directory +DEST_DIR="/tmp" + +# Name of the script file +SCRIPT_FILE="trmm-agentupdate.sh" + +# Download the script from GitHub +wget -O "$DEST_DIR/$SCRIPT_FILE" "$GITHUB_URL" + +if [ $? -eq 0 ]; then + echo "Script downloaded successfully." + + # Schedule the script to run after 2 minutes + echo "bash $DEST_DIR/$SCRIPT_FILE" | at now + 2 minutes + echo "Script scheduled to run after 2 minutes." +else + echo "Failed to download the script from GitHub." +fi \ No newline at end of file