adopted to new installation config file
This commit is contained in:
parent
cd36e752e8
commit
2a7f772d08
|
@ -1,21 +1,24 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DEFAULT_VERSION='2015'
|
SCRIPTLOCATION="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
DAMASK_ROOT=$SCRIPTLOCATION/../../
|
||||||
WORKINGDIR="$( cd "$( dirname "$0" )" && pwd )"
|
# defining set() allows to source the same file for tcsh and bash, with and without space around =
|
||||||
|
set() {
|
||||||
if [ -f $HOME/.damask/damask.conf ]; then
|
export $1$2$3
|
||||||
source $HOME/.damask/damask.conf
|
}
|
||||||
else
|
source $DAMASK_ROOT/CONFIG
|
||||||
source /etc/damask.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "x$MSC_ROOT" != "x" ]; then
|
if [ "x$MSC_ROOT" != "x" ]; then
|
||||||
DEFAULT_DIR=$MSC_ROOT
|
DEFAULT_DIR=$MSC_ROOT
|
||||||
fi
|
fi
|
||||||
|
if [ "x$MARC_VERSION" != "x" ]; then
|
||||||
|
DEFAULT_VERSION=$MARC_VERSION
|
||||||
|
fi
|
||||||
|
if [ "x$DAMASK_BIN" != "x" ]; then
|
||||||
|
BIN_DIR=$DAMASK_BIN
|
||||||
|
fi
|
||||||
|
|
||||||
|
while [ ! -d "$SCRIPTLOCATION/$VERSION" ] || [ -z "$VERSION" ]
|
||||||
while [ ! -d "$WORKINGDIR/$VERSION" ] || [ -z "$VERSION" ]
|
|
||||||
do
|
do
|
||||||
echo "Input version of MARC/MENTAT installation: [${DEFAULT_VERSION}]"
|
echo "Input version of MARC/MENTAT installation: [${DEFAULT_VERSION}]"
|
||||||
read VERSION
|
read VERSION
|
||||||
|
@ -66,7 +69,7 @@ for filename in 'comp_damask' \
|
||||||
'run_damask_lmp' \
|
'run_damask_lmp' \
|
||||||
'run_damask_hmp' \
|
'run_damask_hmp' \
|
||||||
'include_linux64'; do
|
'include_linux64'; do
|
||||||
cp $WORKINGDIR/$VERSION/Marc_tools/$filename $theDIR
|
cp $SCRIPTLOCATION/$VERSION/Marc_tools/$filename $theDIR
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
||||||
echo $filename
|
echo $filename
|
||||||
|
@ -89,7 +92,7 @@ for filename in 'edit_window' \
|
||||||
'kill7' \
|
'kill7' \
|
||||||
'kill8' \
|
'kill8' \
|
||||||
'kill9'; do
|
'kill9'; do
|
||||||
cp $WORKINGDIR/$VERSION/Mentat_bin/$filename $theDIR
|
cp $SCRIPTLOCATION/$VERSION/Mentat_bin/$filename $theDIR
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%EDITOR%:${EDITOR}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%EDITOR%:${EDITOR}:g"
|
||||||
|
@ -101,7 +104,7 @@ echo ''
|
||||||
echo 'copying Mentat menus...'
|
echo 'copying Mentat menus...'
|
||||||
theDIR=$INSTALLDIR/mentat$VERSION/menus
|
theDIR=$INSTALLDIR/mentat$VERSION/menus
|
||||||
for filename in 'job_run.ms'; do
|
for filename in 'job_run.ms'; do
|
||||||
cp $WORKINGDIR/$VERSION/Mentat_menus/$filename $theDIR
|
cp $SCRIPTLOCATION/$VERSION/Mentat_menus/$filename $theDIR
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
|
||||||
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
|
||||||
echo $filename
|
echo $filename
|
||||||
|
@ -121,31 +124,33 @@ chmod 755 $INSTALLDIR/mentat$VERSION/bin/submit{4..9}
|
||||||
chmod 755 $INSTALLDIR/mentat$VERSION/bin/kill{4..9}
|
chmod 755 $INSTALLDIR/mentat$VERSION/bin/kill{4..9}
|
||||||
|
|
||||||
#creating symlinks for run_damask_scripts in /usr/local/bin
|
#creating symlinks for run_damask_scripts in /usr/local/bin
|
||||||
BIN_DIR=/usr/local/bin
|
|
||||||
echo ''
|
if [ -d "$BIN_DIR" ]; then
|
||||||
echo "Do you want to create symlinks for run_damask scripts in ${BIN_DIR} [YES/no] ?"
|
echo ''
|
||||||
read YESNO
|
echo "Do you want to create symlinks for run_damask scripts in ${BIN_DIR} [YES/no] ?"
|
||||||
if [ -z "$YESNO" ]; then
|
read YESNO
|
||||||
YESNO=yes
|
if [ -z "$YESNO" ]; then
|
||||||
fi
|
YESNO=yes
|
||||||
case $YESNO in
|
fi
|
||||||
y* | Y* )
|
case $YESNO in
|
||||||
echo''
|
y* | Y* )
|
||||||
echo 'creating symlinks ...'
|
echo''
|
||||||
echo''
|
echo 'creating symlinks ...'
|
||||||
theDIR=$INSTALLDIR/marc$VERSION/tools
|
echo''
|
||||||
for filename in 'run_damask' \
|
theDIR=$INSTALLDIR/marc$VERSION/tools
|
||||||
'run_damask_l' \
|
for filename in 'run_damask' \
|
||||||
'run_damask_h' \
|
'run_damask_l' \
|
||||||
'run_damask_mp' \
|
'run_damask_h' \
|
||||||
'run_damask_lmp' \
|
'run_damask_mp' \
|
||||||
'run_damask_hmp'; do
|
'run_damask_lmp' \
|
||||||
echo ${filename:4}$VERSION
|
'run_damask_hmp'; do
|
||||||
[ -f $BIN_DIR/${filename:4}$VERSION ] && rm $BIN_DIR/${filename:4}$VERSION
|
echo ${filename:4}$VERSION
|
||||||
ln -s $theDIR/$filename $BIN_DIR/${filename:4}$VERSION
|
[ -f $BIN_DIR/${filename:4}$VERSION ] && rm $BIN_DIR/${filename:4}$VERSION
|
||||||
done
|
ln -s $theDIR/$filename $BIN_DIR/${filename:4}$VERSION
|
||||||
;;
|
done
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
echo 'done.'
|
echo 'done.'
|
||||||
|
|
Loading…
Reference in New Issue