Skip to content

Commit

Permalink
Wait for network
Browse files Browse the repository at this point in the history
  • Loading branch information
schlomo committed Feb 13, 2015
1 parent 25403d9 commit c5a698f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: kiosk-browser
Version: 48
Version: 49
Priority: optional
Section: web
Architecture: all
Expand Down
8 changes: 7 additions & 1 deletion src/usr/share/kiosk-browser/xsession.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
exec &> >(logger -t "kiosk-browser[$$]" )
set -x

KILL_ON_EXIT=
HOME=$( mktemp -d /tmp/kiosk-browser.HOME.XXXXXXXXXXXXX )
Expand All @@ -17,6 +18,12 @@ function exittrap {
}
trap exittrap EXIT # kill subprocesses on exit

# Wait 30 seconds for network by checking for default route
(( end_time=SECONDS+30 ))
until (( SECONDS > end_time)) || [[ "$(ip route)" == *default* ]] ; do
sleep 2 &
wait $!
done

# show debug info for 60 seconds as overlay
{
Expand Down Expand Up @@ -49,7 +56,6 @@ function xrandr_find_other_ports {
grep connect <<<"$XRANDR_OUTPUT" | cut -f 1 -d " " | grep -v $(xrandr_find_port "$1")
}

set -x
if test -r /etc/default/kiosk-browser ; then
source /etc/default/kiosk-browser
fi
Expand Down

0 comments on commit c5a698f

Please sign in to comment.