rminnichmerge57758a716 years agoHistory
118 lines · 2.5 KB · Shell
RawDownload
#!/bin/bash#usage () {printf """installHelp.sh : Script to help installation of  hare binaries to  proper location USAGE: ./installHelp.sh [-l hare_location] WARNING : This script *MUST* be executed from the same directory where is is found,	as it depends on pwd for locating other files. ARGUMENTS :	-l: path to the location where hare binaries will be installed. 	ENVIRONMENT VARIABLES: (Can be used to override defaults in the place of cmdline)	HARE_LOCATION: path to the location where hare binaries will be installed. """ >&2 }  set -e# ENVIRONMENTAL DEFAULTSlflag=$HARE_LOCATION while getopts 'l:' OPTIONdo	case $OPTION in	l)	lflag="$OPTARG"		;;	?)	usage		exit 2		;;	esacdoneshift $((OPTIND - 1)) # SET DEFAULTS IF USER DOESNT SPECIFYif [ -z $pflag ]then	lflag="/bgsys/argonne-utils/profiles/plan9/LATEST/bin/"fimkdir -p $lflag # Change following variables only if code structure changeshare_src_dir="../../../../../" deploy_script_location="/usr/glenda/bin/bash/deploy/" # Find brasil executablebrasil_location=`find "$hare_src_dir/usr/brasil/Linux/" -name brasil`echo "brasil exec location is $brasil_location" # Making sure that it is executableif [ ! -x $brasil_location ]then	echo "ERROR: Could not find brasil executable at $brasil_location"	echo "Make sure that path is correct and code is compiled."	exit 1fi # Copy it to destinationcp -f $brasil_location $lflagecho "Copied brasil"  # Copy the deployBrasil.sh script.script_name="deployBrasil.sh"src="$hare_src_dir/$deploy_script_location/$script_name" # Making sure that it is executableif [ ! -x $src ]then	echo "ERROR: Could not find $script_name executable at $src."	echo "Make sure that path is correct."	exit 1fi # copy it to destinationcp -f $src $lflagecho "Copied $script_name"  # copy the runJob.py script.script_name="runJob.py"src="$hare_src_dir/$deploy_script_location/$script_name" # making sure that it is executableif [ ! -x $src ]then	echo "ERROR: Could not find $script_name executable at $src."	echo "Make sure that path is correct."	exit 1fi # copy it to destinationcp -f $src $lflagecho "Copied $script_name"  # copy the py9p directory.dir_name="py9p"src="$hare_src_dir/$deploy_script_location/$dir_name" # making sure that it is a directory if [ ! -d $src ]then	echo "ERROR: Could not find $dir_name directory at $src."	echo "Make sure that path is correct."	exit 1fi # copy it to destinationcp -rf $src $lflagecho "Copied $dir_name" echo "Done..."