#!/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
ansible-playbook -e "ansible_user=$USERNAME" -e "ansible_password=$PASSWORD" -i inventory-cisco.yml backup_configs-cisco.yml
#ansible-playbook -e "ansible_user=$DFLT_USERNAME ansible_password=$DFLT_PASSWORD" -i inventory.yml -l @backup_configs.retry  backup_configs.yml
chown -R 1000:1000 /configs/
