-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
executable file
·65 lines (65 loc) · 2.3 KB
/
uninstall.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
safe_removal() {
echo Uninstalling the fancyboot plymouth theme...
sudo update-alternatives --quiet --remove default.plymouth /usr/share/plymouth/themes/fancyboot/fancyboot.plymouth
sudo rm -rf /usr/share/plymouth/themes/fancyboot
sudo update-alternatives --quiet --auto default.plymouth
sudo update-initramfs -u
echo Done!
echo Testing...
sudo plymouthd
sudo plymouth --show-splash
sleep 10
sudo plymouth quit
echo Done. Report to author if a problem happens.
sleep 1
}
complete_removal() {
echo "COMPLETE REMOVAL"
if test -f "/usr/share/initramfs-tools/scripts/functions.backup"; then
echo Backup file exists.
else
echo
echo ERROR
echo "File '/usr/share/initramfs-tools/scripts/functions.backup' does not exist. Emergency option is: Safe removal"
echo Aborting Complete removal and starting Safe removal...
echo SAFE REMOVAL
safe_removal
fi
read -p "Do you want to continue ? [y/N] "
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Replacing initramfs functions by backup...
sudo cp /usr/share/initramfs-tools/scripts/functions.backup /usr/share/initramfs-tools/scripts/functions
echo Done!
safe_removal
else
echo Exiting... \(1s left\)
sleep 1
exit
fi
}
echo Please enter your sudo password if you are prompted to do so.
echo
echo
echo WARNING
echo There are __two__ existing uninstalling modes for FancyBoot:
echo " 1 - Safe removal : FancyBoot is deleted and the default theme is set back. Most recommanded option."
echo " 2 - Complete removal : FancyBoot is deleted, the default theme is set back and the initramfs functions file is set back from backup. Read warning below.*"
echo
echo "*Warning: Complete removal can cause serious problems in the filesystem if the '/usr/share/initramfs-tools/scripts/functions.backup' doesn't exist. Those problems can be fatal to your computer."
echo
read -p "Type the number of the chosen option. Default option is 1. Type 'q' to quit. "
echo
if [[ $REPLY =~ ^[1]$ ]]; then
echo "SAFE REMOVAL"
safe_removal
else
if [[ $REPLY =~ ^[2]$ ]]; then
complete_removal
else
if [[ $REPLY =~ ^[q]$ ]]; then
echo "Exiting..."
sleep 1 && exit
fi
fi
fi