Skip to content

Commit ee85604

Browse files
authored
Add reboothack.sh
1 parent 747f128 commit ee85604

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

reboothack.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
3+
4+
# This is a dirty hack to keep the media user logged in.
5+
# For some reason it keeps getting kicked out to the login
6+
# prompt, which means EyeTV is not able to record shows.
7+
8+
# We check to see if the Dock app is running
9+
# If not, wait 30 seconds and check again
10+
# If it's still not running, we reboot the mac and let the
11+
# account auto login as it normally should
12+
13+
LOG="$HOME/reboot.log"
14+
15+
check() {
16+
TEST=$(pgrep -U $(whoami) Dock)
17+
RESULT="$?"
18+
}
19+
20+
check
21+
if [ "$RESULT" = 0 ]
22+
then
23+
echo "$(date) Dock found" >> $LOG
24+
exit
25+
else
26+
echo "$(date) Dock not found, wating 30 seconds" >> $LOG
27+
sleep 30
28+
check
29+
if [ "$RESULT" = 0 ]
30+
then
31+
exit
32+
else
33+
echo "$(date) Dock still not found, rebooting NOW" >> $LOG
34+
sudo reboot
35+
fi
36+
fi

0 commit comments

Comments
 (0)