From 9f31e50ee944934a2e2cae6a92491ecc400cdde1 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Tue, 13 Jun 2017 21:19:46 -0700 Subject: [PATCH] [FIX] point_of_sale: don't launch Firefox before Odoo has started When using Wi-Fi the Odoo instance on the POSBox will start after a Wi-Fi connection is established. This takes a bit longer than when you're using a wired connection. If Firefox gets started before you end up with a 'Could not connect to localhost:8069' error. --- .../overwrite_after_init/etc/xdg/openbox/autostart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/tools/posbox/overwrite_after_init/etc/xdg/openbox/autostart b/addons/point_of_sale/tools/posbox/overwrite_after_init/etc/xdg/openbox/autostart index e2b61e2f591..15908b4c5aa 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_after_init/etc/xdg/openbox/autostart +++ b/addons/point_of_sale/tools/posbox/overwrite_after_init/etc/xdg/openbox/autostart @@ -3,4 +3,11 @@ xset s off xset -dpms export HOME=/tmp -/usr/bin/firefox http://localhost:8069/point_of_sale/display & + +DISPLAY_URL='http://localhost:8069/point_of_sale/display' + +# wait until odoo is ready, otherwise you will have to plug a +# keyboard into the posbox just to refresh firefox +until wget -q "${DISPLAY_URL}" -O /dev/null ; do sleep 1 ; done + +/usr/bin/firefox "${DISPLAY_URL}" &