# bash available on linux, darwin, sunos and aix; it is not available on hp-ux ### this script requires sudo or root priviliges ### run with sh or another appropriate shell # cd to the correct directory for running individual shell scripts. cd /opt/altiris/notification/inventory/var/repo/providers/CltInv_Common/aex-shellprovider/scripts # # remove temp file that will contain output data outfile="/tmp/syminvdata.out" if [ -e $outfile ]; then rm $outfile fi # find the current OS # # Test for OS/Platform. Case-sensitive values used in script names are: AIX, Darwin, HPUX, Linux, Solaris. CurOS=`uname -s` #if [ "$CurOS" = "Linux" ]; then # filemask="*$CurOS*.sh" #fi case "$CurOS" in Linux) filemask="*Linux*.sh" ;; Darwin) filemask="*Darwin*.sh" ;; SunOS) filemask="*Solaris*.sh" ;; HP-UX) filemask="*HPUX*.sh" ;; AIX) filemask="*AIX*.sh" ;; esac # loop thru specific list of directories; run each shell script for appropriate OS # redirect shell script output to the outfile # for dir in CltInv_HW CltInv_OS CltInv_SW CltInv_UG SrvInv_DB SrvInv_OS SrvInv_VM SrvInv_WEB do for file in $dir/$filemask do echo "Processing script: $file" echo "Processing script: $file" >> $outfile ./$file >> $outfile 2>&1 echo >> $outfile echo >> $outfile done done