#!/bin/ksh

cres=0
ret=0

FIC_LSN=/var/opt/oracle/listener.ora

LSN_LIST=`awk -F"=" '/^ *[Ss][Ii][Dd]_[Ll][Ii][Ss][Tt]_/ {print substr($1,10)}' ${FIC_LSN}`

        for LSN in ${LSN_LIST}
        do
                echo "            ${LSN}"

                ${ORA_SRVBIN}/CSIORA_Listener.ksh stop ${LSN}

                ret=$? 
                cres=$(expr ${cres} + ${ret})
                if [ ${ret} -ne 0 ]
                then
                        echo "Probleme arret pour le listener : $LSN " 
                        echo "Verifer le bon arret du listener : $LSN " 
                fi
        done

        echo "code retour = ${cres} "
        exit ${cres}
