diff options
| -rwxr-xr-x | bitbake/bin/toaster | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 2d07255d9b..9540fc9e6c 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
| @@ -69,7 +69,7 @@ webserverStartAll() | |||
| 69 | 69 | ||
| 70 | echo "Starting webserver..." | 70 | echo "Starting webserver..." |
| 71 | 71 | ||
| 72 | $MANAGE runserver "0.0.0.0:$WEB_PORT" \ | 72 | $MANAGE runserver "$ADDR_PORT" \ |
| 73 | </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \ | 73 | </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \ |
| 74 | & echo $! >${BUILDDIR}/.toastermain.pid | 74 | & echo $! >${BUILDDIR}/.toastermain.pid |
| 75 | 75 | ||
| @@ -79,7 +79,8 @@ webserverStartAll() | |||
| 79 | retval=1 | 79 | retval=1 |
| 80 | rm "${BUILDDIR}/.toastermain.pid" | 80 | rm "${BUILDDIR}/.toastermain.pid" |
| 81 | else | 81 | else |
| 82 | echo "Webserver address: http://0.0.0.0:$WEB_PORT/" | 82 | echo "Toaster development webserver started at http://$ADDR_PORT" |
| 83 | echo -e "\nYou can now run 'bitbake <target>' on the command line and monitor your build in Toaster.\nYou can also use a Toaster project to configure and run a build.\n" | ||
| 83 | fi | 84 | fi |
| 84 | 85 | ||
| 85 | return $retval | 86 | return $retval |
| @@ -180,7 +181,7 @@ fi | |||
| 180 | export TOASTER_DIR=`pwd` | 181 | export TOASTER_DIR=`pwd` |
| 181 | 182 | ||
| 182 | WEBSERVER=1 | 183 | WEBSERVER=1 |
| 183 | WEB_PORT="8000" | 184 | ADDR_PORT="localhost:8000" |
| 184 | unset CMD | 185 | unset CMD |
| 185 | for param in $*; do | 186 | for param in $*; do |
| 186 | case $param in | 187 | case $param in |
| @@ -194,7 +195,14 @@ for param in $*; do | |||
| 194 | CMD=$param | 195 | CMD=$param |
| 195 | ;; | 196 | ;; |
| 196 | webport=*) | 197 | webport=*) |
| 197 | WEB_PORT="${param#*=}" | 198 | ADDR_PORT="${param#*=}" |
| 199 | # Split the addr:port string | ||
| 200 | ADDR=`echo $ADDR_PORT | cut -f 1 -d ':'` | ||
| 201 | PORT=`echo $ADDR_PORT | cut -f 2 -d ':'` | ||
| 202 | # If only a port has been speified then set address to localhost. | ||
| 203 | if [ $ADDR = $PORT ] ; then | ||
| 204 | ADDR_PORT="localhost:$PORT" | ||
| 205 | fi | ||
| 198 | ;; | 206 | ;; |
| 199 | *) | 207 | *) |
| 200 | echo "$HELP" | 208 | echo "$HELP" |
| @@ -247,7 +255,7 @@ case $CMD in | |||
| 247 | start ) | 255 | start ) |
| 248 | # check if addr:port is not in use | 256 | # check if addr:port is not in use |
| 249 | if [ "$CMD" == 'start' ]; then | 257 | if [ "$CMD" == 'start' ]; then |
| 250 | $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1 | 258 | $MANAGE checksocket "$ADDR_PORT" || return 1 |
| 251 | fi | 259 | fi |
| 252 | 260 | ||
| 253 | # kill Toaster web server if it's alive | 261 | # kill Toaster web server if it's alive |
