-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·84 lines (72 loc) · 1.77 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
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
AUTORUN=false
while getopts "yash" opt; do
case $opt in
y)
echo "option y"
AUTORUN=true
;;
a)
echo "option a"
AUTORUN=true
;;
s)
echo "option s"
AUTORUN=true
;;
h)
echo ''
echo ' option flags are'
echo ''
echo ' -a (auto run)'
echo ' -y (yes)'
echo ' -s (scripting mode)'
echo ' all above options result in no confirm prompts please use with care'
echo ''
echo ' -h shows this help message' >&2
exit 1
;;
*)
echo ''
echo 'valid option flags are as follows'
echo ''
echo ' -a (auto run)'
echo ' -y (yes)'
echo ' -s (scripting mode)'
echo ' all above options result in no confirm prompts please use with care'
echo ''
echo ' -h (help)' >&2
exit 1
esac
done
echo "playbook-pack-init and playbook-init toolkit uninstaller (Program only)"
if $AUTORUN
then
echo "auto run enabled by flag"
else
while true; do
read -r -p "do you wish to remove this package ? (Y/N) " yn
case $yn in
[Yy]* ) echo processing ; break;;
[Nn]* ) exit;;
* ) echo "Please answer y or n.";;
esac
done
fi
# (ref http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html)
# remove user runnable scripts in /usr/bin
rm -f /usr/bin/playbook_init
rm -f /usr/bin/playbook_update
rm -f /usr/bin/playbook_pack_init
rm -f /usr/bin/playbook_pack_update
# backward compat cleanout
rm -f /usr/bin/playbook-init
rm -f /usr/bin/playbook-update
rm -f /usr/bin/playbook-pack-init
rm -f /usr/bin/playbook-pack-update
# remove supporting folders (scripts only)
rm -rf /usr/lib/playbook_toolkit