Hi, sometimes I need to deploy aplications to run locally and I write this bash script for linux PCs that help to run a web2py application like a desktop one, starting the web2py app in a browser, and killing the web2py process when the browser is closed:

#!/bin/bash
    WEB2PY_PORT="2024"
    WEB2PY_PID_FILE="/tmp/we2py_pid"
    WEB2PY_PASSWORD="password"
    WEB2PY_APP="bdgie"
    WEB2PY_PATH="/path/web2py.py"

python $WEB2PY_PATH -a $WEB2PY_PASSWORD -p $WEB2PY_PORT -d $WEB2PY_PID_FILE & # start web2py in background
    sleep 5 # wait 5 seconds while server starts
sensible-browser http://localhost:$WEB2PY_PORT/$WEB2PY_APP # open web browser with app URL and wait to close
    web2py_pid=`cat $WEB2PY_PID_FILE` # get web2py process id
    kill -SIGTERM $web2py_pid # kill web2py

Now I need do the same in a windows PC, but my batch scripting is not good, so, before I start banging my head against the batch rock, someone has done something like this?.
Any tip will be very useful.

Thanks.

--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to