wget http://www.cubbyusercontent.com/pli/privat24.sh/_66180ac9c7db4b80b57c8fd846ab12f6 -O privat24
ipset —create privat24 iphash —hashsize 4096
#!/bin/bash IPS=`which ipset` DIG=`which dig` CTL=`which sysctl` DNS_lookup="4.2.2.2" pay_ipset="privat24" pay_sites=( # LIQPAY www.liqpay.com liqpay.com static.liqpay.com ecommerce.liqpay.com # PRIVAT www.privat24.ua privat24.ua privat24.privatbank.ua privatbank.ua qrapi.privatbank.ua api.privatbank.ua login.privatbank.ua socauth.privatbank.ua st.privatbank.ua services.privatbank.ua mypayments.privatbank.ua crm.privatbank.ua ) $IPS -F $pay_ipset for site in ${pay_sites[*]} do if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then $IPS add $pay_ipset $site 2> /dev/null else for ip in `$DIG $site +short @$DNS_lookup` do $IPS add $pay_ipset $ip 2> /dev/null done fi done echo "Update pay hosts done"
Правила в фаерволе
$IPTABLES -A FORWARD -s 172.22.0.0/16 -m set --match-set privat24 dst -j ACCEPT $IPTABLES -A FORWARD -s 10.0.121.0/24 -m set --match-set privat24 dst -j ACCEPT
# Allow connect to Privat24
$IPTABLES -t nat -A PREROUTING -s 172.22.0.0/16 -m set —match-set privat24 dst -j ACCEPT
В кроне
00 6 * * * root /usr/local/sbin/privat24.sh > /dev/null
Еще одна реализация
wget http://www.cubbyusercontent.com/pl/paysystems.tar.gz/_b09446745a7d4368b4dcb6b5084c980b -O paysystems.tar.gz
Источник