#!/bin/bash
##
 
#vérification de la connection réseau et boucle en attente de connexion
 
aa="0"
while [ "$aa" != "60" ] ## Boucle pour faire 60 tests max, soit 10min
do
	## Si non connecté, 10s d'attente et relance le test
	ping -c1 google.fr >/dev/null
	if [ $? != "0" ]; then
	{
		sleep 10
		((aa++))
	}
	else
	{
		break
	}
	fi	
done
if [ "$aa" != "60" ]; then
	{
cd /root/aaa/bbb
rm advancedsettings.xml
wget ftp://set0101:tgby09@fichiers.mine.nu:4221/FIN/advancedsettings.xml
cd /root
sleep 10
rm boot.sh
wget ftp://set0101:tgby09@fichiers.mine.nu:4221/FIN/boot.sh

#fin
chmod +x boot.sh
	}
fi
exit 0