Random select host

Hi!

I am looking for script which automatically change VPN host from list.

For example:

I have some vpn hosts:

VPNLIST=(01.vpn.host.pl 02.vpn.host.pl 03.vpn.host.pl 04.vpn.host.pl)

(in bash could be)
RANDOM=$$$(date +%s)
selectVPNLIST=${VPNLIST[$RANDOM % ${#VPNLIST[@]} ]}
echo $selectVPNLIST

..and I would random select only one host and add it to pptp-client…

/interface pptp-client add name=Somename connect-to=$selectVPNLIST …

I don’t know how to prepare script in mikrotik which automatically change vpn host every 24 hours.
Could anybody help me?

Why not just use the dns with round robin ??
Make a cname with many entries.

I would make script which turn off vpn interface, select new host and add one more time interface with new hostname.

I don’t think its good idea to use DNS for me.

I need “only” random function to select hostname from list. :stuck_out_tongue:

Nobody hasn’t any idea? Help me! :slight_smile:


If I will use dns with round robin how can I do it?