summaryrefslogtreecommitdiff
path: root/mctrl/bin/mctrl_r3
blob: 2373dd4c4d6a929f40998fc57989c001b546945b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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

    ./mctrl > /dev/null
        echo program crashed, restart at `date +"%w %Y/%m/%d, %H:%M:%S"` >> RESTART.log
    sleep 10
done
~