#!/usr/bin/bash
openfortivpn vpn.scsd.us:10443 --username=$USERNAME --trusted-cert fda7d7ed64a9bd84562c6643e858c4a61cfdc6e90b0d4ee60e07fd0bb7fb7a9f --password=$PASSWORD &
while [ ! `ip a | grep -q "inet .*ppp" && echo "1"`   ];
do
    #echo checking
    sleep 1
done
sleep 3
mkdir /configs/wlc
fn=wlc-a.cfg
ip=10.1.35.11
python backup_wlcs.py --user admin --password $WLC_PASSWORD --ip $ip --filename /configs/wlc/$fn

fn=wlc-b.cfg
ip=10.1.35.12
python backup_wlcs.py --user admin --password $WLC_PASSWORD --ip $ip --filename /configs/wlc/$fn

fn=wlc-c.cfg
ip=10.1.35.14
python backup_wlcs.py --user admin --password $WLC_PASSWORD --ip $ip --filename /configs/wlc/$fn

fn=wlc-mm.cfg
ip=10.1.35.13
python backup_wlcs.py --user admin --password $WLC_PASSWORD --ip $ip --filename /configs/wlc/$fn

fn=wlc-mm-2.cfg
ip=10.1.35.23
python backup_wlcs.py --user admin --password $WLC_PASSWORD --ip $ip --filename /configs/wlc/$fn


chown -R 1000:1000 /configs/
