projects
/
tpope-extra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7f75972
)
Better xscreensaver detection
author
Tim Pope
<code@tpope.net>
Fri, 3 Sep 2004 19:26:35 +0000
(19:26 +0000)
committer
Tim Pope
<code@tpope.net>
Fri, 3 Sep 2004 19:26:35 +0000
(19:26 +0000)
bin/away-detect
patch
|
blob
|
history
diff --git
a/bin/away-detect
b/bin/away-detect
index a3836e8d00a12ddc7b719d472c9722ac9ca1dabf..9764f75c90d9218950571500f0bf502d5da02d20 100755
(executable)
--- a/
bin/away-detect
+++ b/
bin/away-detect
@@
-108,7
+108,7
@@
done
for host in $livehosts; do
# True if a non-blanked display is found
for host in $livehosts; do
# True if a non-blanked display is found
- $ssh $host 'if DISPLAY=:0.0 xscreensaver-command -
time >/dev/null 2>&1; then if DISPLAY=:0.0 xscreensaver-command -time 2>/dev/null|grep non-blanked
>/dev/null; then true; else pid=`ps ax|grep "[0-9]:[0-9][0-9] ssh .*exec screen.*RR irc"|sed -e "s/^ *//"|cut -d" " -f 1`; [ -f "$HOME/.irc.lock" -o -z "$pid" ] || kill $pid; false; fi; else false; fi' && alive=$host
+ $ssh $host 'if DISPLAY=:0.0 xscreensaver-command -
version >/dev/null 2>&1; then if DISPLAY=:0.0 xscreensaver-command -time 2>&1 |egrep "non-blanked|no saver status"
>/dev/null; then true; else pid=`ps ax|grep "[0-9]:[0-9][0-9] ssh .*exec screen.*RR irc"|sed -e "s/^ *//"|cut -d" " -f 1`; [ -f "$HOME/.irc.lock" -o -z "$pid" ] || kill $pid; false; fi; else false; fi' && alive=$host
done
if ! ping -c 1 mona >/dev/null 2>/dev/null; then
done
if ! ping -c 1 mona >/dev/null 2>/dev/null; then