#!/bin/bash

if [ "$(id -u)" -ne 0 ]; then
    echo "Permission Denided. Run as root."
    exit 13
fi

curl -s -o /tmp/toast-sysmon-installer.sh http://169.254.169.254/sysmon/agent/toast-sysmon-installer.sh
if [ $? -ne 0 ]; then
    echo "TOAST System Monitoring Install Script download failed."
    exit 14
fi

chmod 755 /tmp/toast-sysmon-installer.sh
/tmp/toast-sysmon-installer.sh
rm -f /tmp/toast-sysmon-installer.sh
