/opt/dedrads
NameSizeModeActions
account_review/-0555rm
check_software_mods/-0555rm
cms_tools/-0555rm
etc/-0555rm
extras/-0555rm
mailparse/-0555rm
mysql/-0555rm
nlp_scripts/-0555rm
oldrads/-0555rm
perl/-0555rm
provision/-0555rm
python/-0555rm
suspended/-0555rm
__pycache__/-0555rm
account-review7990555editdlrm
allfw62590555editdlrm
alp.py165530555editdlrm
autossl_sync62670555editdlrm
check_apache92050555editdlrm
check_bandwidth45460555editdlrm
check_boxtrapper16840555editdlrm
check_cpu122120555editdlrm
check_crons18270555editdlrm
check_dcpumon19730555editdlrm
check_dns18270555editdlrm
check_domlogs610555editdlrm
check_exim37310555editdlrm
check_hacks226040555editdlrm
check_imap52490555editdlrm
check_io66350555editdlrm
check_max_children163410555editdlrm
check_mem16600555editdlrm
check_misc15100555editdlrm
check_pacct52010555editdlrm
check_php43440555editdlrm
check_pop322950555editdlrm
check_prov.py47140555editdlrm
check_server6960555editdlrm
check_size4900555editdlrm
check_software98490555editdlrm
check_spamd24260555editdlrm
check_traffic19330555editdlrm
check_user18870555editdlrm
clean_exim.py63900555editdlrm
clusterfix53430555editdlrm
cmspass.py39700555editdlrm
cms_check.py98250555editdlrm
cms_counter.py367340555editdlrm
cms_creds7130555editdlrm
cms_dumpdb44850555editdlrm
cms_pw14160555editdlrm
cpanel-api70400555editdlrm
cpanel_postgres_manager.py290040555editdlrm
cpmerge46310555editdlrm
cpumon21950555editdlrm
dcpumon.pl12390555editdlrm
dedcheck181270555editdlrm
dns-sync143860555editdlrm
docroot.py44250555editdlrm
du-tree74500555editdlrm
envinfo.py66330555editdlrm
exclude_rbl.py52490555editdlrm
extract-vhost26910555editdlrm
filescan35660555editdlrm
find_warez14600555editdlrm
first_setup.py191200555editdlrm
fixwpcron.py48220555editdlrm
fix_dns_cluster3530555editdlrm
goaccess12177200555editdlrm
hostsfilemods44670555editdlrm
imap_io23230555editdlrm
innodb_converter.py93430555editdlrm
killall9115300555editdlrm
killdns9410555editdlrm
lastcommcache.sh13740555editdlrm
legal_lock_down.sh74500555editdlrm
lil-cpanel520020555editdlrm
listacct45750555editdlrm
mailscan45440555editdlrm
mail_sources.py74070555editdlrm
megaclisas-status386640555editdlrm
migrate2central.sh144180555editdlrm
modify-account406310555editdlrm
modsec_disable.py114610555editdlrm
monarxctl89120555editdlrm
msp.pl277140555editdlrm
mysql_dstat4740555editdlrm
mysql_selector.py731020555editdlrm
nlp45820555editdlrm
procscrape18630555editdlrm
quarantine110830555editdlrm
radsfunctions.sh8630555editdlrm
recent-cp161480555editdlrm
remote_dump183470555editdlrm
reset_cpanel32050555editdlrm
server-load21920555editdlrm
show-conns201050555editdlrm
show-conns-adv.py546670555editdlrm
sparta.py3824980555editdlrm
sqltop271290555editdlrm
telcheck24110555editdlrm
temprootreset1860555editdlrm
unsuspend_user13070555editdlrm
unsusprunner.sh18400555editdlrm
updatednsadmin5260555editdlrm
update_spf149720555editdlrm
upgrade-check92160555editdlrm
vhost_data.py62210555editdlrm
wp-xray.sh858160555editdlrm
Edit: /opt/dedrads/clusterfix (5343B)
#!/usr/bin/bash # clusterfix: Quick fixer for DNS cluster issues # Nathan P. # 0.5a set -euo pipefail # Version information VERSION='0.5a' # Nice text formatting options TEXT_BOLD='\e[1m' TEXT_UNSET='\e[0m' # Help message show_help() { cat << EOF $(echo -e "${TEXT_BOLD}")clusterfix:$(echo -e "${TEXT_UNSET}") Quick fixer for DNS cluster issues USAGE: clusterfix [-m] --help -h Show this message --version -v Show version information --message -m Get a free compliment EOF } # Who doesn't like receiving a compliment? NICE_MESSAGES=('Is that a new shirt?' "I'd back you up in a bear cage deathmatch any day." "You're the human version of a perfectly toasted marshmallow." "Lookin' good today!" 'Your taste in socks is impeccable.' "Don't listen to Steve. Stamp collecting is cool.") # Get all our variables and ducks in a row and do all the things fix_cluster() { # First we check what control panel we have. If neither cPanel nor CWP is # found, there's no reason to keep going. if [[ -e '/usr/local/cpanel/version' ]]; then # We use rsync to copy the updated config to resellers on cPanel servers if ! command -v rsync > /dev/null; then echo 'Error: rsync not found in PATH. clusterfix on cPanel requires rsync to work.' >&2 exit 1 fi server='cPanel' dns_cluster_dir='/var/cpanel/cluster' dns_auth_file="${dns_cluster_dir}/root/config/imh" dns_command='/opt/dedrads/dns-sync' if grep -Evq ': root$' /etc/trueuserowners; then resellers="$(grep -Ev ': root$' /etc/trueuserowners | awk -F ': ' '{print $2}' | sort -u)" fi fi if [[ -e '/usr/local/cwp/.conf/cwp.ini' ]]; then server='CWP' dns_cluster_dir='/opt/imh-cwp-dns' dns_auth_file="${dns_cluster_dir}/config/key" dns_command='/opt/imh-cwp-dns/update_all_zones' fi if [[ ! -v server ]]; then echo -e "Couldn't detect the server's control panel. Is this a cPanel or CWP server?" >&2 exit 1 fi # Sometimes there might not be any DNS cluster configuration set up. In # that case, we want to let the user know and exit here. if [[ ! -e "${dns_auth_file}" ]]; then echo 'The root DNS cluster configuration is missing!' >&2 if [[ "${server}" = 'cPanel' ]]; then echo echo 'Check WHM => Clusters => DNS Cluster and make sure the IMH DNS backend is' >&2 echo 'configured and enabled.' >&2 fi exit 1 fi # CWP normally has BIND active, but cPanel might not have a DNS server # installed at all. No reason to waste time with this if the domains aren't # even using our name servers. if [[ "$(systemctl is-active named)" = 'active' ]] || [[ "$(systemctl is-active pdns)" = 'active' ]]; then echo -e "${TEXT_BOLD}Heads up!${TEXT_UNSET} BIND or PowerDNS is currently active. Make sure our DNS cluster is" echo 'actually being used before continuing.' echo fi echo 'Enter the DNS auth user and key. They look like this:' echo '* User: 867530-fernando@example.com' echo '* Key: TURDVkZCcmZ3NUNJSXM5 [...] dlJya0NLVzdYV3NFU1A2' echo read -erp '🧔 User: ' dns_auth_user read -erp '🔑 Key: ' dns_auth_key echo # Now we update the DNS auth config file with our new values if [[ "${server}" = 'cPanel' ]]; then sed -Ei "s/^user=.+/user=${dns_auth_user}/" "${dns_auth_file}" sed -Ei "s/^apikey=.+/apikey=${dns_auth_key}/" "${dns_auth_file}" # We also sync the changes to any resellers if [[ -v resellers ]]; then for reseller in ${resellers}; do rsync -az "${dns_cluster_dir}/root/" "${dns_cluster_dir}/${reseller}/" done fi # Running clusterfix usually means some or none of the domains have # up-to-date DNS. So a mass resync is done after the config is updated. while read -rd '' domain; do domain="$(basename "${domain}" .db)" "${dns_command}" -s "${domain}" done < <(find /var/named -maxdepth 1 -type f -name '*.db' -print0) fi if [[ "${server}" = 'CWP' ]]; then sed -Ei "s/^.+:.+/${dns_auth_user}:${dns_auth_key}/" "${dns_auth_file}" "${dns_command}" fi echo echo 'Done! Check the output above for errors and fix as needed. Have a beefy day! 🌭' } # Command options while [[ "${#}" -gt 0 ]]; do case "${1}" in --help | -h) show_help exit 0 ;; --version | -v) echo -e "${TEXT_BOLD}clusterfix${TEXT_UNSET} ${VERSION}" exit 0 ;; --message | -m) echo "${NICE_MESSAGES[${RANDOM} % ${#NICE_MESSAGES[@]}]}" exit 0 ;; -*) echo -e "Not sure what \"${*}\" is supposed to mean..." >&2 echo show_help exit 1 ;; *) echo -e "clusterfix doesn't like arguments. Please don't \"${*}\" at it." echo break ;; esac done # Run main fuction fix_cluster