Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
bin /
Delete
Unzip
Name
Size
Permission
Date
Action
cron
[ DIR ]
drwxr-xr-x
2025-07-23 04:12
add-pgsql-ipv6-support.sh
564
B
-rwxr-xr-x
2022-09-28 10:30
allow_cl.sh
3.3
KB
-rwxr-xr-x
2024-03-05 16:15
auth-removal.sh
1.95
KB
-rwx------
2023-01-23 13:29
block_ssh.sh
1.15
KB
-rwxr-xr-x
2023-05-23 21:01
cfm_control
4.65
KB
-rwxr-xr-x
2024-03-28 12:14
check_autossl_excluded.sh
6.88
KB
-rwxr-xr-x
2023-05-22 11:59
convert_to_clos.sh
5.73
KB
-rwxr-xr-x
2023-02-09 14:50
convert_to_core.sh
276
B
-rwx------
2025-04-01 06:33
disable_cpbackups.sh
1.39
KB
-rwxr-xr-x
2024-10-10 07:11
domain_check.py
6.24
KB
-rwxr-xr-x
2024-08-27 10:40
grubinst6.sh
230
B
-rwxr-xr-x
2022-10-27 11:41
grubinst7.sh
323
B
-rwxr-xr-x
2024-01-24 12:57
install-ipa.sh
2
KB
-rwxr-xr-x
2024-09-26 04:24
install-ipa.sh.bak
2.37
KB
-rwxr-xr-x
2023-07-05 13:07
install_cloudlinux.sh
1.31
KB
-rwxr-xr-x
2022-09-29 15:30
install_csf.sh
2.91
KB
-rwx------
2023-05-08 10:57
install_elasticsearch.sh
2.19
KB
-rwx------
2022-07-25 14:24
install_litespeed.sh
4.33
KB
-rwx------
2024-06-13 10:28
install_multiphp.sh
976
B
-rwx------
2022-10-10 14:55
install_redis.sh
709
B
-rwx------
2022-09-28 10:30
ipmicfg
429.04
KB
-rwxr-xr-x
2023-10-04 10:59
lets_encrypt_accept.sh
306
B
-rwxr-xr-x
2024-05-14 09:32
mailqueue_check.sh
1.65
KB
-rwxr-xr-x
2022-04-11 09:40
mysql_minor_upgrade.sh
9.33
KB
-rwxr-xr-x
2024-09-11 17:25
server-scripts_deployer.sh
13.54
KB
-rwxr-xr-x
2024-03-28 12:59
set_autossl_onlynotify_expiry.sh
1.91
KB
-rwxr-xr-x
2022-09-14 08:37
updatecfips.sh
1.62
KB
-rwxr-xr-x
2023-05-22 11:59
wp_plugin_scan.py
14.8
KB
-rw-------
2025-01-21 11:31
Save
Rename
#!/bin/bash # Ref - SYSENG-12930 - this script is to download latest tar of app/bin repo via m5new & sync changes locally # # # variables salt_minion_os="CloudLinux-7" salt_minion_control_panel="cpanel" salt_minion_platform="mdedi" server_scripts_tar_file="server-scripts-a2-app-bin.tar.gz" server_scripts_tar_url="https://m5.a2hosting.com/scripts/${server_scripts_tar_file}" appbin_git_tmp="/root/.tmp_appbin_git" app_bin_deployer_log="/var/log/app_bin_deployer.log" appbin_log_time="$(date '+%Y-%m-%d %H:%M:%S') $(hostname -s) $0" local_git_dir_full_path="${appbin_git_tmp}/app/git/server-scripts" salt_status=$(/opt/bin/cfm_control status | awk '{ print $3 }') # SYSENG-27068 check if salt is enabled if [ "$salt_status" = "disabled" ]; then echo "${appbin_log_time}: The salt service is disabled, exiting." | tee -a ${app_bin_deployer_log} exit 1 fi if ! (salt-call test.ping &> /dev/null); then echo "${appbin_log_time}: Error: Unable to reach Salt master, exiting." | tee -a ${app_bin_deployer_log} exit 1 fi # 1. ensure Salt populated variables as needed else exit before running this script if [ -z "${salt_minion_os}" ] || [ -z "${salt_minion_control_panel}" ] || [ -z "${salt_minion_platform}" ]; then echo -e "${appbin_log_time}: Exiting, one or more Salt jinja variables is empty: os: ${salt_minion_os} , cp: ${salt_minion_control_panel} , role: ${salt_minion_platform}" exit fi # 2. convert various OS into c7/c8 and add none as no supported OS if [[ "${salt_minion_os}" == "CloudLinux-8" ]] || [[ "${salt_minion_os}" == "AlmaLinux-8" ]]; then salt_minion_os_short="al8" elif [[ "${salt_minion_os}" == "CloudLinux-7" ]] || [[ "${salt_minion_os}" == "CentOS Linux-7" ]]; then salt_minion_os_short="c7" else salt_minion_os_short="none" fi # 3. set single variable for both mvps and mdedi if [[ "${salt_minion_platform}" == "reseller" ]]; then salt_minion_platform="shared" elif [[ "${salt_minion_platform}" == "mvps" ]] || [[ "${salt_minion_platform}" = "mdedi" ]]; then salt_minion_platform="mvps.mdedi" fi # 4. exit if os, role not supported as per salt grains if [[ "${salt_minion_os_short}" == "c7" ]] || [[ "${salt_minion_os_short}" == "al8" ]]; then if [[ "${salt_minion_platform}" == "shared" ]] || [[ "${salt_minion_platform}" == "mvps.mdedi" ]] || [[ "${salt_minion_platform}" == "internal" ]]; then echo -e "${appbin_log_time}: OS & platform checks passed, continuing.." | tee -a ${app_bin_deployer_log} else echo -e "${appbin_log_time}: role ${salt_minion_platform} is not supported." | tee -a ${app_bin_deployer_log} exit fi else echo -e "${appbin_log_time}: os ${salt_minion_os} is not supported." | tee -a ${app_bin_deployer_log} exit fi # 5. a function for c7 servers to sync app-bin scripts from local temporary git directory to /app/bin appbin_sync_files_c7() { # c7 shared/reseller/turbo - sync if [[ ${salt_minion_platform} = "shared" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi # c7 mvps & mdedi - sync elif [[ ${salt_minion_platform} = "mvps.mdedi" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi # c7 internal - sync elif [[ ${salt_minion_platform} = "internal" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" fi fi } # 6. a function for c8 servers to sync app-bin scripts from local temporary git directory to /app/bin appbin_sync_files_c8() { # c8 shared/reseller/turbo - sync if [[ ${salt_minion_platform} = "shared" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi # c8 mvps/mdedi - sync elif [[ ${salt_minion_platform} = "mvps.mdedi" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi # c8 internal - sync elif [[ ${salt_minion_platform} = "internal" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" ]]; then echo -e "${appbin_log_time}: stage_rsync.1.1 - Copying from: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}"/* /app/bin/ ; then echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy completed." else echo -e "${appbin_log_time}: stage_rsync.1.2 - Local git to app/bin copy failed" fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}" fi fi } # 7. shortcut to each above functions to reduce scripting run_appbin_sync_files() { if [[ "${salt_minion_os_short}" = "al8" ]]; then appbin_sync_files_c8 2>&1 | tee -a ${app_bin_deployer_log} elif [[ "${salt_minion_os_short}" = "c7" ]]; then appbin_sync_files_c7 2>&1 | tee -a ${app_bin_deployer_log} fi } # 8. this function is to collect logs if files have been modified locally before we overwrite appbin_check_sync() { local_git_dir_full_path="${appbin_git_tmp}/app/git/server-scripts" app_bin_split="${salt_minion_platform}.${salt_minion_control_panel}" appbin_git_source_path="${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" appbin_destination_path="/app/bin" for app_bin_script in $(find "${appbin_git_source_path}" -type f | awk -F "${app_bin_split}/" '{print $2}'); do appbin_src_md5=$(md5sum ${appbin_git_source_path}/${app_bin_script} | awk '{print $1}') appbin_dst_md5=$(md5sum ${appbin_destination_path}/${app_bin_script} | awk '{print $1}') if [[ "${appbin_src_md5}" != "${appbin_dst_md5}" ]]; then echo "changed file ${app_bin_script}: md5sum ${appbin_src_md5} | ${appbin_dst_md5}" fi done } # 9. this function ensures we sync files as cron runs but we don't overwrite a2dig/new_migrate scripts that gets passwords from salt run_appbin_sync_files_cron() { if [[ "${salt_minion_os_short}" = "c7" ]] && [[ "${salt_minion_platform}" = "shared" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then appbin_check_sync if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo "${appbin_log_time}: stage_rsync.1.3 - Local /app/bin is in sync with remote." else echo "${appbin_log_time}: stage_rsync.1.3 - Local /app/bin is NOT in sync with remote." fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi elif [[ "${salt_minion_os_short}" = "al8" ]] && [[ "${salt_minion_platform}" = "shared" ]]; then if [[ -d "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" ]]; then appbin_check_sync if rsync -a --chmod=750 "${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}"/* /app/bin/ ; then echo "${appbin_log_time}: stage_rsync.1.3 - Local /app/bin is in sync with remote." else echo "${appbin_log_time}: stage_rsync.1.3 - Local /app/bin is NOT in sync with remote." fi else echo -e "${appbin_log_time}: stage_rsync.1.1 - no directory found with path: ${local_git_dir_full_path}/${salt_minion_os_short}/${salt_minion_platform}.${salt_minion_control_panel}" fi else run_appbin_sync_files fi } # 10. this function for first run to ensure latest tar exists & temporary local git directory, if not staging if [[ -d "${appbin_git_tmp}" ]] && [[ -f "${appbin_git_tmp}/${server_scripts_tar_file}" ]]; then echo -e "${appbin_log_time}: stage.1.1 - Local app-bin tar & app-bin git temporary directory already exists." | tee -a ${app_bin_deployer_log} elif curl -sI ${server_scripts_tar_url} | grep OK ; then echo "${appbin_log_time}: stage.1.1 - Local app-bin tar & app-bin git directory does not exists, downloading now." | tee -a ${app_bin_deployer_log} wget "${server_scripts_tar_url}" -P "${appbin_git_tmp}" &>/dev/null tar -xf "${appbin_git_tmp}/${server_scripts_tar_file}" -C "${appbin_git_tmp}" run_appbin_sync_files else echo "${appbin_log_time}: stage.1.2 - Failed to download file: ${server_scripts_tar_url}" | tee -a ${app_bin_deployer_log} fi # 11. ensure local / remote tar byte size is same, if not, download from remote & sync locally if curl -sI ${server_scripts_tar_url} | grep OK ; then remote_content_in_bytes=$(curl -sI "${server_scripts_tar_url}" | grep Content-Length | awk '{print $NF}' |tr -d '\r') local_content_in_bytes=$(stat -c%s "${appbin_git_tmp}/${server_scripts_tar_file}") if [[ "${remote_content_in_bytes}" != "${local_content_in_bytes}" ]]; then echo -e "${appbin_log_time}: stage_remote.1.1 - Remote and local tar files are not in sync downloading latest copy" | tee -a ${app_bin_deployer_log} rm -f "${appbin_git_tmp}/${server_scripts_tar_file}" wget "${server_scripts_tar_url}" -P "${appbin_git_tmp}" tar -xf "${appbin_git_tmp}/${server_scripts_tar_file}" -C "${appbin_git_tmp}" pkill -9 salt-call; sleep 5; salt-call state.apply >/dev/null 2>&1; sleep 5 run_appbin_sync_files else echo -e "${appbin_log_time}: stage.1.2 - Local tar is in sync with remote tar." | tee -a ${app_bin_deployer_log} fi else echo "${appbin_log_time}: stage.1.3 - Failed to download file: ${server_scripts_tar_url}" | tee -a ${app_bin_deployer_log} fi # 12. ensure to sync local files to prevent modifications & exclude files run_appbin_sync_files_cron 2>&1 | tee -a ${app_bin_deployer_log} # 13. rotate log file appbin_log_file_size="$(stat -c%s ${app_bin_deployer_log})" if [[ -n "${appbin_log_file_size}" ]] && [[ "${appbin_log_file_size}" -gt "1000000" ]]; then mv ${app_bin_deployer_log} ${app_bin_deployer_log}.log.1 fi