forked from Argonne-National-Laboratory/ProMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·52 lines (42 loc) · 845 Bytes
/
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
#!/bin/bash
#
# script to uninstall ProMC
# S.Chekanov. ANL
CURRENT_DIR=`pwd`
PROMC_DIR=$1
installdir=$CURRENT_DIR"/.installdir"
if [ -f "$installdir" ]
then
echo ""
else
echo " Error: Cannot find installation";
echo " Did you compile it? Exit.";
exit 1;
fi
DLINE=""
file=$installdir
while read line
do
DLINE="$line"
done < "$file"
LEN=$(echo ${#DLINE})
if [ -z "$DLINE" ]
then
echo "ProMC installation not found"
exit 1
fi
echo "ProMC is installed in $DLINE"
# check
while true; do
echo -ne '\E[37;44m'"\033[1m Uninstall ProMC from $DLINE? (y/n) :\033[0m"
read yn
case $yn in
y* | Y* ) command ; break ;;
[nN]* ) echo "Not uninstalled!" ; exit; break ;;
q* ) exit ;;
* ) echo "Enter yes or no" ;;
esac
done
rm -rf $DLINE
rm -f $installdir
echo "-> ProMC was uninstalled!"