-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDesintegrationDom.sh
More file actions
42 lines (34 loc) · 1.44 KB
/
Copy pathDesintegrationDom.sh
File metadata and controls
42 lines (34 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#v1.1
# Le but de ce script est de faire l'inverse du script d'intégration au domaine c'est à dire :
# Retirer du domaine un Ubuntu (ou variante) qui a été précédemment intégré avec le script d'intégration.
#############################################
# Run using sudo, of course.
#############################################
if [ "$UID" -ne "0" ]
then
echo "Il faut etre root pour executer ce script. ==> sudo "
exit
fi
apt-get purge -y ldap-auth-client libpam-mount cifs-utils nscd numlockx unattended-upgrades
rm -f /etc/ldap.conf
rm -f /usr/share/pam-configs/my_groups
rm -f /etc/auth-client-config/profile.d/open_ldap
rm -f /usr/share/pam-configs/mkhomedir
rm -f /etc/lightdm/logonscript.sh
rm -f /etc/lightdm/logoffscript.sh
rm -f /usr/share/lightdm/lightdm.conf.d/50-no-guest.conf
sed -i "s/enabled=False/enabled=True/g" /etc/xdg/user-dirs.conf
# Uniquement pour le cas ou Esubuntu a été installé
apt-get remove -y zenity conky
rm -rf /usr/local/upkg_client
rm -f /etc/xdg/autostart/message_scribe.desktop
rm -f /etc/xdg/autostart/scribe_background.desktop
rm -f /etc/GM_ESU
rm -f /etc/lightdm/groupe.sh
echo "" > /etc/crontab #remplacement du contenu d'esubuntu par du contenu vide
echo "Désintégration terminé"
read -p "Il est fortement recommandé de redémarrer, voulez-vous le faire immédiatement ? [O/n] " rep_reboot
if [ "$rep_reboot" = "O" ] || [ "$rep_reboot" = "o" ] || [ "$rep_reboot" = "" ] ; then
reboot
fi