forked from acg-team/tral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteTRAL.sh
executable file
·80 lines (68 loc) · 2.41 KB
/
deleteTRAL.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
79
80
#!/usr/bin/env bash
######################
# UNINSTALLING TRAL AND ITS EXTERNAL SOFTWARE
######################
######################
### Prepare Filesystem
#provide paths from config file (has to be in the same directory than setupTRAL.sh)
. configTRAL_path.cfg
shopt -s nocasematch # making comparisons case-insensitive
set -euo pipefail # exit on errors and undefined vars
######################
### Delete TRAL
# delete tral path system
read -p "Are you sure to delete TRAL? yes(y) or no (n):" yn
case $yn in
[Yy]* )
rm -rf "$TRAL_PATH" || {
echo -e "Was not able to delete TRAL"
exit 1
}
;;
[Nn]* )
echo -e ".tral was not removed."
;;
esac
# delete all the config files of the virtualenvs
read -p "Do you wish to delete all configuration files and data as well? yes(y) or no (n):" yn
case $yn in
[Yy]* )
rm -rf "$TRAL_CONF" || {
echo -e "Was not able to delete .tral"
exit 1
}
;;
[Nn]* )
echo -e ".tral was not removed."
;;
esac
echo -e "---------------------------------------------"
echo -e "TRAL and its whole pathsystem is now deleted."
echo -e "---------------------------------------------\n"
######################
### Delete external software of TRAL
# delete the directory with external software used by TRAL
read -p "Do you wish to uninstall all external software as well? yes(y) or no (n):" yn
case $yn in
[Yy]* )
{
. uninstall_all_ext_software.sh &&
rm -rf "$TRAL_EXT_SOFTWARE"
echo -e "\n----------------------------------------------"
echo -e "External Software deleted."
echo -e "----------------------------------------------\n"
echo -e "\n----------------------------------------------"
echo -e 'Uninstallation of TRAL successfully completed.'
echo -e "----------------------------------------------\n"
} || {
echo -e "\nA problem occured while trying to delete the external software."
exit 1
}
;;
[Nn]* )
echo -e "\nExternal Software was not deleted and can (if it was available before) still be found in $TRAL_EXT_SOFTWARE."
echo -e "\n----------------------------------------------"
echo -e 'Uninstallation of TRAL successfully completed.'
echo -e "----------------------------------------------\n"
;;
esac