22 lines
498 B
Plaintext
22 lines
498 B
Plaintext
|
|
#!/bin/sh
|
||
|
|
|
||
|
|
while [ 1 ]; do
|
||
|
|
count=`ls -l core.* |wc -l`
|
||
|
|
echo $count
|
||
|
|
if [ $count -lt 5 ]
|
||
|
|
then
|
||
|
|
echo "set unlimited"
|
||
|
|
ulimit -c unlimited
|
||
|
|
else
|
||
|
|
ulimit -c 0
|
||
|
|
fi
|
||
|
|
|
||
|
|
rssb_num=`ps -ef|grep rssb_maskey$|wc -l`
|
||
|
|
if [ $rssb_num -lt 1 ]
|
||
|
|
then
|
||
|
|
./rssb_maskey &>/dev/null &
|
||
|
|
echo program crashed, restart at `date +"%w %Y/%m/%d, %H:%M:%S"` >> RESTART.log
|
||
|
|
fi
|
||
|
|
sleep 10
|
||
|
|
done
|