Hello,
I was asked to modify below script to adapt it to Solaris 11.3. I am not sure if it is ksh or bash, but need your assistance to do it for Solaris 11.3
## Variables
flag="/sysadm/bin/queue_enabler.flg"
set -A maillist unixadm@unixhost.tv
############
##### Remove logs older than 1 week #####
cd /tmp && find . -name "queue_enabler.*" -mtime +6 -exec rm {} \;
#########################################
echo "\n`date +'%D %T'`\n" >> /tmp/queue_enabler.`date +'%m%d'`
if [[ -e $flag ]]
then
for mail in ${maillist[@]}
do
echo "Duplicate queue_enabler11 process with ID $$ running"|mail -s test_unixhost_check_queue_enabler $mail
done
exit 1
fi
echo $$ >> $flag
for i in `lsallq`
do
status=`enq -s -P $i|grep $i|awk '{print $3}'`
if [[ $status = DOWN ]]
then
print "Queue $i found DOWN and enabled on `date +'%D %T'`" >> /tmp/queue_enabler.`date +'%m%d'`
qadm -U $i
fi
done
rm $flag
Thank you in advance!