On Mon, 03 Jan 2000, [EMAIL PROTECTED] wrote:
>Can anyone give me some idea on how I could start mprime on my linux box during 
>bootup and have it check to see if it is running periodically and restart it if it 
>isnt?

Here's a pair of scripts I use for NFSNET. Substitute mprime for sieve and
ignore the battery stuff if your box isn't a laptop. Run periodically from your
crontab.

phma
--- # ~/nfsieve/batcheck
#!/bin/bash
 
# Checks the battery. If it is not 100%, suspend sieve.
 
sievepid=`/sbin/pidof sieve`
 
if [ -z $sievepid ] ; then
  if [ -f /home/phma/nfsieve/nfs.out ] ; then
    /home/phma/nfsieve/sieben
  fi
else
  if [ `/usr/bin/battery` = "100%" ] ; then
    kill -CONT $sievepid
    renice 20 $sievepid >/dev/null
  else
    kill -STOP $sievepid
  fi
fi
--- # /usr/bin/battery
#!/bin/sh
cut -f 7 -d " " /proc/apm
_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to