#!/bin/bash
read -p "This script should be run on Primtux to synchronise ldap do you want to continue [y/N]" ans
if [ "$ans" != "y" ]
then
    exit 1
fi
echo "Re creating users"
for user in 01-mini 02-super 03-maxi direction prof
do
    sudo adduser --force-badname $user
done
echo "Disabling LDAP"
sudo sed -ie 's/ ldap//' /etc/nsswitch.conf
echo "Removing Proxy"
for f in /home/*/.profile
do
    sudo sed -ie 's/export .*_PROXY=.*slis:3128.*$//' $f
done
echo "All done, exit and re-open your session to see the changes"
