| Server IP : 172.67.178.83 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/wpos/scriptlets/ |
Upload File : |
#!/bin/bash
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
# Note: Also called from Debian
# Arguments:
# RPM
# $1 == 1 - install package
# $1 == 2 - upgrade package
# DEB
# $1 == configure - RPM post/posttrans
# "wpos POST TRANS STARTED"
rhel=$2
_clshare=$3
clwpos_redis_extension_installer=$4
clwpos_cleaner_cron=$5
clwpos_collect_information_cron=$6
add_clwpos_crons=$7
_clshare_wpos=${8}
# migrate configs to latest ones
# FIXME: be able to use some "service" commands everywhere, currently whole utility is blocked
# it affects tests, when packages are being installed -> could be no supported edition
#cloudlinux-awp-admin migrate-configs
#{
# "result": "Unable to run /usr/bin/cloudlinux-awp-admin utility, AccelerateWP is supported only ..",
# "timestamp": 1705501896.0210168
#}
# /usr/bin/cloudlinux-awp-admin migrate-configs &> /dev/null &
/opt/cloudlinux/venv/bin/python3 -c "from clwpos.migrations import migrate_configs; migrate_configs()" &>/dev/null
nohup /opt/cloudlinux/venv/bin/python3 -c "from clwpos.logsetup import setup_logging; setup_logging('clwpos.utils'); from clwpos.utils import cleanup_legacy_wp_config_backups; cleanup_legacy_wp_config_backups()" &>/dev/null &
# Setup Cloudlinux WPOS daemon
"$_clshare_wpos"/wpos_daemon_setup.py
# regenerate cron files to update their contents if needed
/usr/bin/cloudlinux-awp-admin sync-cron-files &> /dev/null
# Regenerate info.json files
nohup /usr/sbin/clwpos_collect_information.py &> /dev/null &
# Restart WPOS daemon
/sbin/service clwpos_monitoring try-restart
# Install WPOS hooks
"$_clshare_wpos"/wpos_hooks.py --install > /dev/null
# Add to cagefs:
# - clwpos-user utility
# - /usr/bin/cloudlinux-awp-user symlink
# - file 'controlpanelname' to allow user to detect control panel
if [ -f /usr/sbin/cagefsctl ]; then
echo -e "/usr/bin/clwpos-user\n/usr/bin/cloudlinux-awp-user\n/var/cache/controlpanelname" \
| /usr/sbin/cagefsctl --wait-lock --update-list &> /dev/null &
fi
# only if this is an update versions before_rename -> with_rename
# /var/clwpos/admin/awp_migration_needed.v1 will be removed in code after manual admin click
# migration is not needed for those who did enable anything yet
if [[ -f /var/clwpos/admin/awp_migration.v1 ]]; then
if cloudlinux-awp-admin get-options | grep "\"show_icon\": true" &> /dev/null; then
touch /var/clwpos/admin/awp_migration_needed.v1
fi
rm -f /var/clwpos/admin/awp_migration.v1 > /dev/null
fi
# Install and update the extension for Plesk for interaction of the CloudLinux Advantage WHMCS addon
# with AccelerateWP commands
if [ -f "/usr/sbin/plesk" ]; then
/usr/sbin/plesk bin extension -i /usr/share/cloudlinux/plesk-accelerate-wp-latest.zip &> /dev/null
/usr/sbin/plesk bin extension --enable accelerate-wp &> /dev/null
fi
# to trigger configuration of Redis not waiting cron job
/usr/share/cloudlinux/wpos/enable_redis_for_alt_php.py &> /dev/null
# Create user UID directories like /var/clwpos/uids/1000
/opt/cloudlinux/venv/bin/python3 -c "from clwpos.create_user_uid_dirs import create_user_uid_dirs; create_user_uid_dirs()" &>/dev/null
# "wpos POST TRANS FINISHED"