This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
remove.sh
executable file
·78 lines (69 loc) · 2.41 KB
/
remove.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
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
# remove.sh - desinstalador do BatService
#
# This file is part of BatService.
#
# BatService is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BatService is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BatService. If not, see <https://www.gnu.org/licenses/>.
if [ $(id -u) -eq 0 ]; then
echo "O BatService é instalado normalmente sem root, e deve ser removido também desta forma"
exit 1
fi
EXIT_FILE="$PREFIX/etc/batservice/exit.err"
if [ ! -r "EXIT_FILE" ]; then
echo "Encerrando BatService. Isto não deve demorar mais que 1 minuto"
touch $EXIT_FILE
tm=60
while [ -r $EXIT_FILE ]; do
if [ $tm -eq 0 ]; then
rm $EXIT_FILE
break
fi
tm=$(expr $tm - 1)
sleep 1
done
fi
echo "Removendo BatService e todos os arquivos dependentes..."
rm $HOME/.termux/boot/batservice-*.sh
rm $PREFIX/bin/batservice.sh
rm $PREFIX/lib/batservice/perms.sh
rm $PREFIX/lib/batservice/error.sh
rm $PREFIX/lib/batservice/config.sh
rm $PREFIX/lib/batservice/battery.sh
rm $PREFIX/lib/batservice/notify*
rm $PREFIX/lib/batservice/env.rc
rm $PREFIX/lib/batservice/consts.sh
rm $PREFIX/lib/batservice/log.sh
rm $PREFIX/lib/batservice/events.sh
rmdir $PREFIX/lib/batservice
rm $PREFIX/share/batservice/COPYING
rmdir $PREFIX/share/batservice
echo "Remover configuração e cache?"
echo "Isto também removerá tarefas programadas por você! [y/N]"
read sel
if [ "$sel" = "y" ] || [ "$sel" = "Y" ]; then
rm $PREFIX/etc/batservice/config.txt
rm $PREFIX/etc/batservice/user-configs.sh
rm $PREFIX/etc/batservice/user-events.sh
rmdir $PREFIX/etc/batservice
rm $HOME/.cache/BatService/out.log
rmdir $HOME/.cache/BatService
else
echo "Você pode remover manualmente um dos seguintes arquivos:"
echo "CONFIG: $PREFIX/etc/batservice/config.txt"
echo "CACHE: $HOME/.cache/BatService/out.log"
echo "EVENTS: $PREFIX/etc/batservice/user-events.sh"
echo "CONFIGS: $PREFIX/etc/batservice/user-configs.sh"
fi
echo "Terminado!"
echo "by cleds.upper"