From 41fafc183e15e1b121dcd5ee9c443bbf4f600087 Mon Sep 17 00:00:00 2001 From: Danny de Kooker Date: Wed, 6 Sep 2023 11:43:31 +0200 Subject: [PATCH] Add Task_scripts/Linux - Schedule agent update.sh --- Task_scripts/Linux - Schedule agent update.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Task_scripts/Linux - Schedule agent update.sh 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