All pastes #13339 Raw Edit

CPU Process Script

public text v1 · immutable
#13339 ·published 2005-06-04 03:57 UTC
rendered paste body

#!/bin/sh

HIGHLOAD=80

while sleep 5
do
    load=$(cat /proc/loadavg | cut -d " " -f1 | tr -d ".")
    if [ "$load" -gt "$HIGHLOAD" ]
    then
        /tmp/./gpio enable 2
        /tmp/./gpio disable 3
    else
        /tmp/./gpio enable 3
        /tmp/./gpio disable 2
    fi
done