From b7733bae9d62bd2a10936527f82fab05858bab17 Mon Sep 17 00:00:00 2001 From: GARDAIS Jeremy Date: Wed, 11 May 2016 11:59:37 +0200 Subject: [PATCH] Check if user is on univ-rennes1 network. --- install_windows/01_install_backuppc.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install_windows/01_install_backuppc.sh b/install_windows/01_install_backuppc.sh index edfed6d..77326ee 100755 --- a/install_windows/01_install_backuppc.sh +++ b/install_windows/01_install_backuppc.sh @@ -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