2
0

Add Task_scripts/Linux - Schedule agent update.sh

This commit is contained in:
2023-09-06 11:43:31 +02:00
parent f76fa53ae5
commit 41fafc183e

View File

@@ -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