/
opt
/
dedrads
/
/opt/dedrads
mkdir
upload
Name
Size
Mode
Actions
account_review/
-
0555
rm
check_software_mods/
-
0555
rm
cms_tools/
-
0555
rm
etc/
-
0555
rm
extras/
-
0555
rm
mailparse/
-
0555
rm
mysql/
-
0555
rm
nlp_scripts/
-
0555
rm
oldrads/
-
0555
rm
perl/
-
0555
rm
provision/
-
0555
rm
python/
-
0555
rm
suspended/
-
0555
rm
__pycache__/
-
0555
rm
account-review
799
0555
edit
dl
rm
allfw
6259
0555
edit
dl
rm
alp.py
16553
0555
edit
dl
rm
autossl_sync
6267
0555
edit
dl
rm
check_apache
9205
0555
edit
dl
rm
check_bandwidth
4546
0555
edit
dl
rm
check_boxtrapper
1684
0555
edit
dl
rm
check_cpu
12212
0555
edit
dl
rm
check_crons
1827
0555
edit
dl
rm
check_dcpumon
1973
0555
edit
dl
rm
check_dns
1827
0555
edit
dl
rm
check_domlogs
61
0555
edit
dl
rm
check_exim
3731
0555
edit
dl
rm
check_hacks
22604
0555
edit
dl
rm
check_imap
5249
0555
edit
dl
rm
check_io
6635
0555
edit
dl
rm
check_max_children
16341
0555
edit
dl
rm
check_mem
1660
0555
edit
dl
rm
check_misc
1510
0555
edit
dl
rm
check_pacct
5201
0555
edit
dl
rm
check_php
4344
0555
edit
dl
rm
check_pop3
2295
0555
edit
dl
rm
check_prov.py
4714
0555
edit
dl
rm
check_server
696
0555
edit
dl
rm
check_size
490
0555
edit
dl
rm
check_software
9849
0555
edit
dl
rm
check_spamd
2426
0555
edit
dl
rm
check_traffic
1933
0555
edit
dl
rm
check_user
1887
0555
edit
dl
rm
clean_exim.py
6390
0555
edit
dl
rm
clusterfix
5343
0555
edit
dl
rm
cmspass.py
3970
0555
edit
dl
rm
cms_check.py
9825
0555
edit
dl
rm
cms_counter.py
36734
0555
edit
dl
rm
cms_creds
713
0555
edit
dl
rm
cms_dumpdb
4485
0555
edit
dl
rm
cms_pw
1416
0555
edit
dl
rm
cpanel-api
7040
0555
edit
dl
rm
cpanel_postgres_manager.py
29004
0555
edit
dl
rm
cpmerge
4631
0555
edit
dl
rm
cpumon
2195
0555
edit
dl
rm
dcpumon.pl
1239
0555
edit
dl
rm
dedcheck
18127
0555
edit
dl
rm
dns-sync
14386
0555
edit
dl
rm
docroot.py
4425
0555
edit
dl
rm
du-tree
7450
0555
edit
dl
rm
envinfo.py
6633
0555
edit
dl
rm
exclude_rbl.py
5249
0555
edit
dl
rm
extract-vhost
2691
0555
edit
dl
rm
filescan
3566
0555
edit
dl
rm
find_warez
1460
0555
edit
dl
rm
first_setup.py
19120
0555
edit
dl
rm
fixwpcron.py
4822
0555
edit
dl
rm
fix_dns_cluster
353
0555
edit
dl
rm
goaccess
1217720
0555
edit
dl
rm
hostsfilemods
4467
0555
edit
dl
rm
imap_io
2323
0555
edit
dl
rm
innodb_converter.py
9343
0555
edit
dl
rm
killall911
530
0555
edit
dl
rm
killdns
941
0555
edit
dl
rm
lastcommcache.sh
1374
0555
edit
dl
rm
legal_lock_down.sh
7450
0555
edit
dl
rm
lil-cpanel
52002
0555
edit
dl
rm
listacct
4575
0555
edit
dl
rm
mailscan
4544
0555
edit
dl
rm
mail_sources.py
7407
0555
edit
dl
rm
megaclisas-status
38664
0555
edit
dl
rm
migrate2central.sh
14418
0555
edit
dl
rm
modify-account
40631
0555
edit
dl
rm
modsec_disable.py
11461
0555
edit
dl
rm
monarxctl
8912
0555
edit
dl
rm
msp.pl
27714
0555
edit
dl
rm
mysql_dstat
474
0555
edit
dl
rm
mysql_selector.py
73102
0555
edit
dl
rm
nlp
4582
0555
edit
dl
rm
procscrape
1863
0555
edit
dl
rm
quarantine
11083
0555
edit
dl
rm
radsfunctions.sh
863
0555
edit
dl
rm
recent-cp
16148
0555
edit
dl
rm
remote_dump
18347
0555
edit
dl
rm
reset_cpanel
3205
0555
edit
dl
rm
server-load
2192
0555
edit
dl
rm
show-conns
20105
0555
edit
dl
rm
show-conns-adv.py
54667
0555
edit
dl
rm
sparta.py
382498
0555
edit
dl
rm
sqltop
27129
0555
edit
dl
rm
telcheck
2411
0555
edit
dl
rm
temprootreset
186
0555
edit
dl
rm
unsuspend_user
1307
0555
edit
dl
rm
unsusprunner.sh
1840
0555
edit
dl
rm
updatednsadmin
526
0555
edit
dl
rm
update_spf
14972
0555
edit
dl
rm
upgrade-check
9216
0555
edit
dl
rm
vhost_data.py
6221
0555
edit
dl
rm
wp-xray.sh
85816
0555
edit
dl
rm
Edit:
/opt/dedrads/clusterfix
(5343B)
#!/usr/bin/bash # clusterfix: Quick fixer for DNS cluster issues # Nathan P. <nathanpat@inmotionhosting.com> # 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
Save
cmd:
run