#!/bin/sh # TAKE SCREENCAPTURE #ON# BANG LOCATION=/Volumes/STORE/screencaptures/ BANG=ON echo "STARTED SCREENCAPTURE" while [ "$BANG" = "ON" ] do BANG=`sed -n '/BANG/p' /Users/christoph/scripts/screenshooter.sh |\ head -1 |\ cut -d "#" -f 2` AFXCPU=`top -u -FR -l4 |\ grep After |\ cut -d "%" -f 1 |\ rev |\ cut -d "." -f 1-2 |\ cut -d " " -f 1 |\ rev |\ tail -1 |\ cut -d "." -f 1` echo $AFXCPU if [ $AFXCPU -ge 50 ] ; then FILENAME=`date '+%F--%H-%M'` echo $FILENAME screencapture $LOCATION/MAIN_$FILENAME.png $LOCATION/SECONDARY_$FILENAME.png fi sleep 60 done echo "STOPPED SCREENCAPTURE" exit 0;