MythTVP5K operation

From LinuxTVWiki
Revision as of 10:23, 10 October 2008 by Dareni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

mythCheck.sh

 #!/bin/bash
 
 typeset -i PROCESSES=`ps -e |grep mythfrontend|awk '{
 	if(match($0,"mythfrontend")>0){
 	  x++ 
         }
         if(match($0,"grep")>0){
           y++
         }
         }END{
            if(x==""){x=0;}
            if(y==""){y=0;} 
            print x-y
         }'`
 
 if [ $PROCESSES == 0 ]; then
   #echo shutdown
   exit 0;
 else
   #echo do not shutdown
   exit 1;
 fi
 exit 0;
 

mythDoShut.sh