[Bf-cycles] Pause

ZonedCode Media zonedcodemedia at gmail.com
Wed Jun 6 03:59:54 CEST 2012


     Robert,
     Thank you very much for that script.
     God Bless,
     Gavin Howard
On Jun 5, 2012 11:11 AM, "Kovacsics Róbert" <kovirobi at gmail.com> wrote:

> Seems it did not like the attachment, so here it is:
> #!/bin/bash -x
>
> declare -a STOPPED_PIDS
>
> temp=($(cat /sys/class/thermal/thermal_zone*/temp))
> OLDIFS=$IFS
> IFS="
> "
> for i in "${temp[@]}"; do
>    if [ "$i" -gt 95000 ]; then
>        cpu_hog=($(ps a -o pid --sort -cp | grep -v "PID"))
>        ps=$(echo ${cpu_hog[0]} | grep -o "^[[:space:]]*[[:digit:]]*")
>        STOPPED_PIDS[${#STOPPED_PIDS[@]}]=$ps
>        echo ${STOPPED_PIDS[@]}
>        kill -19 ${STOPPED_PIDS[@]}
>        /usr/bin/logger "Stopped ${STOPPED_PIDS[@]} because of high
> CPU temperature"
>        ( sleep 2m; kill -18 ${STOPPED_PIDS[@]}) &
>        sleep 5s
>        break;
>    fi
> done
> IFS=$OLDIFS
> sleep 10s
> exec $0
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20120605/10251038/attachment.htm 


More information about the Bf-cycles mailing list