- # more /etc/listup.sh
- a=0
- b=4
- n=2
- until [[ $a -eq $b ]];do
- # a=`ifconfig tun | cut -f 1 -d ":" | grep -i tun | wc -l`
- a=`ifconfig tun | grep -i 125 | wc -l`
- echo "Jumlah tun interface:" $a
- if [[ $a -eq $b ]];then
- echo "Jumlah tun tepat!"
- echo "Starting pf rule for loadbalancing..."
- /sbin/pfctl -f /etc/pf-loadbal1.conf
- /usr/bin/logger -t pf-LOADBALANCE "Speedy up!"
- else
- echo "Jumlah interface tun seharusnya:$b"
- echo "Koneksi speedy belum up semua, menunggu $n detik"
- sleep $n
- /usr/bin/logger -t pf-LOADBALANCE "Speedy down!"
- fi
- done
- #
4 years ago
No comments:
Post a Comment