-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUndoPiKiosk.sh
More file actions
executable file
·79 lines (67 loc) · 2.65 KB
/
Copy pathUndoPiKiosk.sh
File metadata and controls
executable file
·79 lines (67 loc) · 2.65 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
###########################################
# Simple Script to undo all changes made to pi to
# Create pi Kiosk
############################################
# Logo Call
echo "###################################################"
echo "###################################################"
echo -e "\n"
cat jhart_shell_logo.txt
echo -e "\n"
echo "###################################################"
echo "###################################################"
#############################################
echo -e "\n"
echo "##################################################"
echo "##################################################"
while true; do
echo "This script will remove the configuration changes made by running the KioskInstall script. This will return your pi back to its natural state after a reboot. Are you sure you want to continue? (If so answer with 'Yes please.' If not please answer with 'No')"
read _Undo
if [ "$_Undo" == "Yes please!" ];
then
_Boot_Config=$(ls /boot/ | grep "config.txt.DSbackup")
echo "Now going to revert changes made to the pi during KioskInstall : '$_Boot_Config'"
if [ "" == "$_Boot_Config" ];
then
echo "Nothing to be changed in /boot/config.txt"
else
echo "Changing /boot/config.txt back to original state."
sudo rm -rf /boot/config.txt
sudo mv /boot/config.txt.DSbackup /boot/config.txt
fi
_Autostart_Check=$(ls /etc/xdg/lxsession/LXDE-pi/ | grep "autostart.backup")
echo -e "\nLooking to see if autostart has been changed. If so reverting it back to original : '$_Autostart_Check'"
if [ "" == "$_Autostart_Check" ];
then
echo "Nothing to be changed in autostart config."
else
echo "Changing autostart config back to original state."
sudo rm -rf /etc/xdg/lxsession/LXDE-pi/autostart
sudo mv /etc/xdg/lxsession/LXDE-pi/autostart.DSbackup /etc/xdg/lxsession/LXDE-pi/autostart
fi
_Kiosk_Ran=$(ls /etc/lightdm/ | grep "lightdm.conf.backup")
echo -e "\nChecking to see if mouse cursor has been disabled : '$_Kiosk_Ran'"
if [ "" == "$_Kiosk_Ran" ];
then
echo "No configuration changes need to be made."
sleep 3
else
echo "Reverting the /etc/lightdm/lightdm.conf file back to original state. This will allow your mouse cursor to return after rebooting your pi."
sleep 5
sudo rm -rf /etc/lightdm/lightdm.conf
sudo mv /etc/lightdm/lightdm.conf.DSbackup /etc/lightdm/lightdm.conf
fi
break
else
if [ "$_Undo" == "No" ];
then
echo "No changes will be made."
break
fi
fi
done
########################################################################
echo -e "\nAll done!! Please reboot your pi for changes to take effect. Thank you -Jhart"
sleep 3
exit