fix update clients

This commit is contained in:
Antonio J. Delgado 2023-01-31 00:10:17 +02:00
parent 38a8b3cddd
commit 595e8d1320

View file

@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
declare clients=( hiljainen.susurrando.com www.susurrando.com oc.koti.site) declare clients=( hiljainen.susurrando.com deu1.susurrando.com adpvm01.susurrando.com adpvm02.susurrando.com adpvm03.susurrando.com adpvm04.susurrando.com)
rm /etc/postfix/allowed_clients rm /etc/postfix/allowed_clients
touch /etc/postfix/allowed_clients touch /etc/postfix/allowed_clients
chown postfix.postfix /etc/postfix/allowed_clients chown postfix.postfix /etc/postfix/allowed_clients
chmod o-rwx /etc/postfix/allowed_clients chmod o-rwx /etc/postfix/allowed_clients
postmap /etc/postfix/allowed_clients
for client in "${clients[@]}" for client in "${clients[@]}"
do do
client_ip=$(dig "${client}" | grep -v '^;' |grep "\sA\s" | awk '{print($5)}') client_ip=$(dig "${client}" | grep -v '^;' |grep "\sA\s" | awk '{print($5)}')
echo "${client_ip} OK" >> /etc/postfix/allowed_clients echo "${client_ip} OK" >> /etc/postfix/allowed_clients
done done
postmap /etc/postfix/allowed_clients