|
|
|
@ -4,7 +4,7 @@
|
|
|
|
# © 2021-2022 DigitalOcean LLC.
|
|
|
|
# © 2021-2022 DigitalOcean LLC.
|
|
|
|
# This code is licensed under Apache 2.0 license (see LICENSE.md for details)
|
|
|
|
# This code is licensed under Apache 2.0 license (see LICENSE.md for details)
|
|
|
|
|
|
|
|
|
|
|
|
VERSION="v. 1.8"
|
|
|
|
VERSION="v. 1.8.1"
|
|
|
|
RUNDATE=$( date )
|
|
|
|
RUNDATE=$( date )
|
|
|
|
|
|
|
|
|
|
|
|
# Script should be run with SUDO
|
|
|
|
# Script should be run with SUDO
|
|
|
|
@ -75,7 +75,7 @@ function checkAgent {
|
|
|
|
echo -en "\e[41m[FAIL]\e[0m DigitalOcean directory detected.\n"
|
|
|
|
echo -en "\e[41m[FAIL]\e[0m DigitalOcean directory detected.\n"
|
|
|
|
((FAIL++))
|
|
|
|
((FAIL++))
|
|
|
|
STATUS=2
|
|
|
|
STATUS=2
|
|
|
|
if [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]]; then
|
|
|
|
if [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]] || [[ $OS == "AlmaLinux" ]] || [[ $OS == "CloudLinux" ]]; then
|
|
|
|
echo "To uninstall the agent: 'sudo yum remove droplet-agent'"
|
|
|
|
echo "To uninstall the agent: 'sudo yum remove droplet-agent'"
|
|
|
|
echo "To remove the DO directory: 'find /opt/digitalocean/ -type d -empty -delete'"
|
|
|
|
echo "To remove the DO directory: 'find /opt/digitalocean/ -type d -empty -delete'"
|
|
|
|
elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]]; then
|
|
|
|
elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]]; then
|
|
|
|
@ -357,7 +357,7 @@ function checkFirewall {
|
|
|
|
# shellcheck disable=SC2031
|
|
|
|
# shellcheck disable=SC2031
|
|
|
|
((WARN++))
|
|
|
|
((WARN++))
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]]; then
|
|
|
|
elif [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]] || [[ $OS == "AlmaLinux" ]] || [[ $OS == "CloudLinux" ]]; then
|
|
|
|
if [ -f /usr/lib/systemd/system/csf.service ]; then
|
|
|
|
if [ -f /usr/lib/systemd/system/csf.service ]; then
|
|
|
|
fw="csf"
|
|
|
|
fw="csf"
|
|
|
|
if [[ $(systemctl status $fw >/dev/null 2>&1) ]]; then
|
|
|
|
if [[ $(systemctl status $fw >/dev/null 2>&1) ]]; then
|
|
|
|
@ -456,7 +456,7 @@ function checkUpdates {
|
|
|
|
echo -en "\e[32m[PASS]\e[0m There are no pending security updates for this image.\n\n"
|
|
|
|
echo -en "\e[32m[PASS]\e[0m There are no pending security updates for this image.\n\n"
|
|
|
|
((PASS++))
|
|
|
|
((PASS++))
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]]; then
|
|
|
|
elif [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]] || [[ $OS == "AlmaLinux" ]] || [[ $OS == "CloudLinux" ]]; then
|
|
|
|
echo -en "\nChecking for available security updates, this may take a minute...\n\n"
|
|
|
|
echo -en "\nChecking for available security updates, this may take a minute...\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
update_count=$(yum check-update --security --quiet | wc -l)
|
|
|
|
update_count=$(yum check-update --security --quiet | wc -l)
|
|
|
|
@ -506,7 +506,7 @@ osv=0
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $OS == "Ubuntu" ]]; then
|
|
|
|
if [[ $OS == "Ubuntu" ]]; then
|
|
|
|
ost=1
|
|
|
|
ost=1
|
|
|
|
if [[ $VER == "22.04" ]] || [[ $VER == "20.04" ]] || [[ $VER == "18.04" ]] || [[ $VER == "16.04" ]]; then
|
|
|
|
if [[ $VER == "24.04" ]] || [[ $VER == "22.10" ]] || [[ $VER == "22.04" ]] || [[ $VER == "20.04" ]] || [[ $VER == "18.04" ]] || [[ $VER == "16.04" ]]; then
|
|
|
|
osv=1
|
|
|
|
osv=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
@ -522,6 +522,12 @@ elif [[ "$OS" =~ Debian.* ]]; then
|
|
|
|
11)
|
|
|
|
11)
|
|
|
|
osv=1
|
|
|
|
osv=1
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
12)
|
|
|
|
|
|
|
|
osv=1
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
13)
|
|
|
|
|
|
|
|
osv=1
|
|
|
|
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|
osv=2
|
|
|
|
osv=2
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
@ -542,12 +548,28 @@ elif [[ $OS == "CentOS Stream" ]]; then
|
|
|
|
ost=1
|
|
|
|
ost=1
|
|
|
|
if [[ $VER == "8" ]]; then
|
|
|
|
if [[ $VER == "8" ]]; then
|
|
|
|
osv=1
|
|
|
|
osv=1
|
|
|
|
|
|
|
|
elif [[ $VER == "9" ]]; then
|
|
|
|
|
|
|
|
osv=1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
osv=2
|
|
|
|
osv=2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif [[ $OS == "Rocky Linux" ]]; then
|
|
|
|
elif [[ $OS == "Rocky Linux" ]]; then
|
|
|
|
ost=1
|
|
|
|
ost=1
|
|
|
|
if [[ $VER =~ 8\. ]]; then
|
|
|
|
if [[ $VER =~ 8\. ]] || [[ $VER =~ 9\. ]]; then
|
|
|
|
|
|
|
|
osv=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
osv=2
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [[ $OS == "AlmaLinux" ]]; then
|
|
|
|
|
|
|
|
ost=1
|
|
|
|
|
|
|
|
if [[ "$VER" =~ 8.* ]] || [[ "$VER" =~ 9.* ]]; then
|
|
|
|
|
|
|
|
osv=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
osv=2
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [[ $OS == "CloudLinux" ]]; then
|
|
|
|
|
|
|
|
ost=1
|
|
|
|
|
|
|
|
if [[ "$VER" =~ 8.* ]] || [[ "$VER" =~ 9.* ]]; then
|
|
|
|
osv=1
|
|
|
|
osv=1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
osv=2
|
|
|
|
osv=2
|
|
|
|
@ -599,6 +621,12 @@ checkRoot
|
|
|
|
|
|
|
|
|
|
|
|
checkAgent
|
|
|
|
checkAgent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Source GPU compatibility check
|
|
|
|
|
|
|
|
if [ -f "$(dirname "$0")/check_gpu_support.sh" ]; then
|
|
|
|
|
|
|
|
source "$(dirname "$0")/check_gpu_support.sh"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "GPU check script not found. Skipping GPU compatibility checks."
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Summary
|
|
|
|
# Summary
|
|
|
|
echo -en "\n\n---------------------------------------------------------------------------------------------------\n"
|
|
|
|
echo -en "\n\n---------------------------------------------------------------------------------------------------\n"
|
|
|
|
|