MythTVP5K operation

From LinuxTVWiki
Revision as of 10:23, 10 October 2008 by Dareni (talk | contribs) (New page: ==mythCheck.sh== #!/bin/bash typeset -i PROCESSES=`ps -e |grep mythfrontend|awk '{ if(match($0,"mythfrontend")>0){ x++ } if(match($0,"grep")>0){ ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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