@ -4,7 +4,7 @@
# © 2021-2022 DigitalOcean LLC.
# 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 )
# Script should be run with SUDO
@ -75,7 +75,7 @@ function checkAgent {
echo -en "\e[41m[FAIL]\e[0m DigitalOcean directory detected.\n"
( ( FAIL++) )
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 remove the DO directory: 'find /opt/digitalocean/ -type d -empty -delete'"
elif [ [ $OS = = "Ubuntu" ] ] || [ [ $OS = = "Debian" ] ] ; then
@ -357,7 +357,7 @@ function checkFirewall {
# shellcheck disable=SC2031
( ( WARN++) )
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
fw = "csf"
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"
( ( PASS++) )
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"
update_count = $( yum check-update --security --quiet | wc -l)
@ -506,7 +506,7 @@ osv=0
if [ [ $OS = = "Ubuntu" ] ] ; then
ost = 1
if [ [ $VER = = "2 2.04" ] ] || [ [ $VER = = "20.04" ] ] || [ [ $VER = = "18.04" ] ] || [ [ $VER = = "16.04" ] ] ; then
if [ [ $VER = = "2 4.04" ] ] || [ [ $VER = = "22.10" ] ] || [ [ $VER = = "2 2.04" ] ] || [ [ $VER = = "20.04" ] ] || [ [ $VER = = "18.04" ] ] || [ [ $VER = = "16.04" ] ] ; then
osv = 1
fi
@ -521,7 +521,13 @@ elif [[ "$OS" =~ Debian.* ]]; then
; ;
11)
osv = 1
; ;
; ;
12)
osv = 1
; ;
13)
osv = 1
; ;
*)
osv = 2
; ;
@ -542,12 +548,28 @@ elif [[ $OS == "CentOS Stream" ]]; then
ost = 1
if [ [ $VER = = "8" ] ] ; then
osv = 1
elif [ [ $VER = = "9" ] ] ; then
osv = 1
else
osv = 2
fi
elif [ [ $OS = = "Rocky Linux" ] ] ; then
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
else
osv = 2
@ -599,6 +621,12 @@ checkRoot
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
echo -en "\n\n---------------------------------------------------------------------------------------------------\n"
@ -625,4 +653,4 @@ elif [[ $STATUS == 1 ]]; then
else
echo -en "Some critical tests failed. These items must be resolved and this scan re-run before you submit your image to the DigitalOcean Marketplace.\n\n"
exit 1
fi
fi