]> spindle.queued.net Git - autox/blobdiff - autox
actually use AUTOX_USER rather than the hardcoded olpc user
[autox] / autox
diff --git a/autox b/autox
index 02dcbabdc826f9fab7920ff03d68c38c63e8f815..245bc3b4aa534eb9f6f65cc4c633132b1573ffae 100755 (executable)
--- a/autox
+++ b/autox
@@ -3,13 +3,18 @@
 TIMEOUT=20
 PIDFILE=/var/run/autox.pid
 
+if [ -z "$1" ]; then
+       echo "Usage: $0 <username>" 1>&2
+       exit 1
+fi
+
 echo $$ > $PIDFILE
 trap "rm -f $PIDFILE; killall -9 startx" 0
 fails=0
   
 while true; do
        start_time=`date "+%s"`
-       openvt -w -- su -c startx olpc
+       openvt -w -- su -c startx $1
        end_time=`date "+%s"`
 
        timediff=$((end_time-start_time))