Translate into your own language

Friday, April 15, 2016

OSWatcher auto startup script

#!/bin/bash

RON=`ps -ef | grep OSWatcher | grep -v 'grep' | wc -l`
echo $RON

function startOSwather
{
cd /u02/OSWatcher/oswbb/
echo ^M | nohup ./startOSWbb.sh 60 168 bzip2 &
}

if [ ${RON} -eq 1 ]
then
        psid=`ps -ef | grep OSWatcher | grep -v 'grep' | awk '{print $2}'`
        echo $psid

        kill -9 $psid
        startOSwather
elif [ ${RON} -eq 0 ]
then
startOSwather
fi

No comments:

Post a Comment