-
Notifications
You must be signed in to change notification settings - Fork 3
/
Un_install_dealerV2_4.bash
executable file
·55 lines (48 loc) · 1.55 KB
/
Un_install_dealerV2_4.bash
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
#!/bin/bash
# File UN-install.bash -- JGM -- 2024-06-30
#set -x
ROOT_ID=0
if [[ $UID -ne $ROOT_ID ]] ; then
echo "You should run this script as root"
echo "Type sudo $0 and enter password when prompted"
exit -5
fi
echo "This will Uninstall DealerV2_4 and delete all the files in /usr/local/games/DealerV2_4 and /usr/local/games/DOP!!"
read -rp "Continue? [Yn]" ANSW
if [[ $ANSW == "Y" || $ANSW == "Yes" ]] ; then
echo "Bombs Away !"
else
echo "Safe choice!" ; exit
fi
DISTRODIR="$PWD"
HOMEDIR="/home/${USER}"
ROOTDIR="/usr/local/games/"
#ROOTDIR="/tmp/games/"
RUNDIR="/usr/local/bin/"
#RUNDIR="/tmp/local/bin/"
PGMVER="DealerV2_4/"
PGMDIR="${ROOTDIR}${PGMVER}"
OPCDIR="${ROOTDIR}DOP/"
EXEDIR="${PGMDIR}bin/"
LIBDIR="${PGMDIR}lib/"
DIRLIST="bin dat Debug DebugExamples docs DOP Examples exe include lib Prod Regression src stdlib UserEval"
SUDO_USER=$USER
echo "Removing the symlinks in $RUNDIR "
rm ${RUNDIR}/dop
rm ${RUNDIR}/gibcli
rm ${RUNDIR}/fdp
rm ${RUNDIR}fdpi
rm ${RUNDIR}dealdbg
rm ${RUNDIR}dealerv2
rm ${RUNDIR}DealerServer
rm ${RUNDIR}DealerSrvdbg
cd $ROOTDIR
chmod -R 777 ${PGMDIR}/* ${OPCDIR}/*
echo Removing "${PGMDIR} and all its files "
rm -R ${PGMDIR}/*
rmdir ${PGMDIR}
echo Removing "${OPCDIR} and all its files "
rm -R ${OPCDIR}/*
rmdir ${OPCDIR}
echo Dealver2 Version ${PGMVER} and the OPC Perl script Un-installed
echo You might want to modify your \$PATH in .bashrc to remove the $RUNDIR but you might use it for other things and no harm to leave it.