Skip to content
Snippets Groups Projects
Commit b26f7ace authored by an7s's avatar an7s
Browse files

better sanity checks in case tries to install 2x

Former-commit-id: e62a21e7a5bee89f321ae6073d5c6636400f7c60
parent 6682e0ef
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,14 @@ PROG=$(basename $0 .install.sh)
# Default installation directory
INSTALL_DIR=/tmp/protected/bin
if [ ! -d analysis_dir ]; then
echo "Looks like you've already installed ${PROG}"
echo
echo "Type any key to continue"
read anykey
exit 1
fi
echo "Installing protected version of $PROG"
echo "Installation directory: $INSTALL_DIR"
echo "Fully qualified path: $INSTALL_DIR/$PROG"
......@@ -14,18 +22,19 @@ echo
echo "Type any key to continue"
read anykey
# in case it's not there yet
mkdir -p $INSTALL_DIR
chmod +x analysis_dir/a.stratafied
# wipe out any old installs
if [ -d "$INSTALL_DIR/${PROG}_analysis" ]; then
rm -fr "$INSTALL_DIR/${PROG}_analysis"
rm -fr "$INSTALL_DIR/${PROG}_analysis"
fi
#cp -r analysis_dir $INSTALL_DIR/${PROG}_analysis
mv analysis_dir $INSTALL_DIR/${PROG}_analysis
echo "$INSTALL_DIR/${PROG}_analysis/ps_run.sh $INSTALL_DIR/${PROG}_analysis \"\$0\" \"\$@\"" > $INSTALL_DIR/$PROG
echo "$INSTALL_DIR/${PROG}_analysis/ps_run.sh $INSTALL_DIR/${PROG}_analysis \"\$0\" \"\$@\"" > $INSTALL_DIR/$PROG
chmod +x $INSTALL_DIR/$PROG
echo "Installation complete"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment