Autor: warlord
Mai 12, 2008, 15:52:47
Bzw. wäre es so dann wohl besser. So riskiert man keinen ungewollt schlafenden Mac, wenn Lightwave nicht gestartet ist.
Code: [Auswählen]
#!/bin/bash
ps ax -o "cpu,command" | grep Light >> /tmp/light.txt
cat /tmp/light.txt | grep Lightwave >> /tmp/light2.txt
LIGHTWAVE_RUNNING=`cat /tmp/light2.txt`
if [ "$LIGHTWAVE_RUNNING" != "" ] && [ "${LIGHTWAVE_RUNNING:0:3}" == " 0" ]; then
osascript <<GoodNight
tell application "System Events" to sleep
GoodNight
fi
rm /tmp/light.txt
rm /tmp/light2.txt