TYPE-0
FILEMANAGER
UP LEVEL
HOME
EXIT
Current Directory:
scripts2
/
EDIT: list_defaddr_fwd.sh
#!/bin/bash # Notify of undesirable cPanel Default Address settings for emails. Expected result is ":fail:". HOSTNAME=$(hostname) EMAIL="sysadmin@sitioshispanos.com" INFRACTORS=$(mktemp) WANTED=":fail:" if [ "$HOSTNAME" == "dns.webhosting-network-services.com" ]; then echo "This is the DNS server. SKIP." exit 1 fi whmapi1 --output=jsonpretty listaccts | jq -r .data.acct[].user | while read -r acc; do uapi --output=json --user="$acc" Email list_default_address user="$acc" | jq -r '.result.data[] | "\(.domain) \(.defaultaddress)"' | while read -r opt; do if [[ "$opt" =~ "$WANTED" ]]; then break fi echo "$acc $opt" >> $INFRACTORS done done { while read acc dom defaddr do if [ "$acc" == "sitios" ]; then continue fi if [ "$defaddr" == "$acc" ]; then mode="DEFAULT" elif [ "$defaddr" =~ "\":blackhole:\"" ]; then mode="BLACKHOLE" else mode="FORWARD" fi if [ "$mode" == "FORWARD" ]; then echo "$acc: $dom -> $defaddr" fi done } < "$INFRACTORS"
SAVE CHANGES
BACK TO DIR
TYPE-0 MANAGER © 2026 |
System Ready