Professional Documents
Culture Documents
Marc 16 Script
Marc 16 Script
Marc 16 Script
/bin/bash
# Execute getopt
HEIGHT=15
WIDTH=60
CHOICE_HEIGHT=4
BACKTITLE="Select License Server"
TITLE="Mentat Launcher"
MENU="Choose one of the following options:"
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
LIC_SERVER="27500@indux20"
;;
2)
LIC_SERVER="27500@indux19"
;;
esac
#cat ~/.bashrc
echo $LIC_SERVER
# File name
readonly PROGNAME=$(basename $0)
# File name, without the extension
readonly PROGBASENAME=${PROGNAME%.*}
# File directory
readonly PROGDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Arguments
readonly VARARGS="$@"
# Arguments number
readonly ARGNUM="$#"
if [ $# -eq 0 ]; then
usage
exit 0
fi
jused=$1
nprocdused=$2
options+=" $options_other"
echo "Options used for thi job are as below"
echo $options
case $nprocdused in
1) lic=160 ;;
2) lic=$(echo "scale=2; 200 / 2" | bc) ;;
3) lic=$(echo "scale=2; 225 / 3" | bc) ;;
4) lic=$(echo "scale=2; 250 / 4" | bc) ;;
5) lic=$(echo "scale=2; 265 / 5" | bc) ;;
6) lic=$(echo "scale=2; 280 / 6" | bc) ;;
7) lic=$(echo "scale=2; 295 / 7" | bc) ;;
8) lic=$(echo "scale=2; 310 / 8" | bc) ;;
esac
#oldlic=$lic
#
#read -p "Please enter number of CAMPUS licenses required: Current value is $lic :
" lic
#
#if [ -z "$lic" ]; then
#lic=$oldlic
#fi
exec >&3-
read -p "Do you want to select compute node for this job (y/n)?" nodeyes
if [ "$nodeyes" == "y" ]; then
else
echo "Submitting the job"
qsub marc_job_submit_script.sh
fi