Check if user is on univ-rennes1 network.

This commit is contained in:
Jeremy Gardais 2016-05-11 11:59:37 +02:00
parent 3cc032e857
commit b7733bae9d
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,13 @@ case $lang in
*) group_name="Backup Operators" ;;
esac
ip_ur1=$(wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d" " -f 6 | cut -d\< -f 1 | cut -d'.' -f1-2)
if [[ ${ip_ur1} != "129.20" ]]; then
printf "Merci de vous connecter au réseau 'univ-rennes1' et relancer le 01_install_backuppc.exe\n"
exit 1
fi
net user backuppc $(openssl rand -base64 8) /add # Creation compte backuppc (mot de passe aleatoire)
#net localgroup "Administrateurs" backuppc /add # Ajout des droits admin a backuppc
net localgroup "$group_name" backuppc /add