#!/bin/bash
# vim:tabstop=4:softtabstop=0:shiftwidth=4 
# runmuli shell script front end to the muli
#
#|=============================================================================|
#|                *** PROPRIETARY RIGHTS NOTICE ***                            |
#|   This material contains proprietary information of MULI Holdings P/L,      |
#|   Wahroonga, NSW, Australia and/or its licensor, embodying                  |
#|   "CONFIDENTIAL INFORMATION" ideas and expressions, no part of which may    |
#|   be reproduced or transmitted without permission of MULI Management P/L.   |
#|      ***  COPYRIGHT  1982 - 2013  ***  MULI Holdings P/L  ***               |
#|                          All rights reserved.                               |
#|=============================================================================|
#Version Who   When     Desc
#
#=>V15-001	BrowCh	28.02.19	R00000652	change for mbbag_run
#=> 03     BrowCh 22/03/10 fix %3D and add xmessage
#=> 02     BrowCh 22/03/10 tidy up
#=> 01     BrowCh 03/02/10 simplify for now
#=> 00     BrowCh 21/12/09 First pass script
#=.
#|-----------------------------------------------------------------------------
#*//

no_args=${#}
echo " syht $*" > /tmp/${UID}.out
for iarg in ${*}
do
	case ${iarg} in
		--maxwindow%3D*)
			#echo "maxwindow= ${iarg}"
			maxwindow=${iarg#--maxwindow%3D}
			max="--maxwindow=${maxwindow}"
			continue
			;;
		--offset%3D*)
			#echo "offset = ${iarg}"
			offset=${iarg#--offset%3D}
			off="--offset=${offset}"
			continue
			;;
		--normalwindow%3D*)
			#echo "normalwindow= ${iarg}"
			normalwindow=${iarg#--normalwindow%3D}
			normal="--normalwindow=${normalwindow}"
			;;
		*)	echo "all other: ${iarg}"
			echo "all other: ${iarg}" >> /tmp/${UID}.out
			if [ -x /usr/bin/xmessage ]
			then
				/usr/bin/xmessage -center "Fallover: unknow option ${iarg}"
				exit 1
			fi
			;;
	esac
done
echo "/usr/local/muli/bin/mbbag_run ${normal} ${max} ${off}" >>/tmp/${UID}.out
/usr/local/muli/bin/mbbag_run ${normal} ${max} ${off}

