Queue enabler for Solaris 11.3

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!

From the set -A, it looks like ksh to me.

1 Like

Yes, and only ksh has print .
You must make available (i.e. install) the software that has the commands lsallq enq qadm .
You might need to set PATH=/bin:/usr/bin:/path/to/software/bin at the beginning of the script.

The task is to adapt that ksh script to Solaris 11.3, but AIX commands included on it, I do not know the equivalent in Solaris...

If you don't know what this script is for, this is going to be an uphill battle.