view io2012slides/serve.sh @ 2:7f4128b2369a

update seminar slides
author taiki <taiki@cr.ie.u-ryukyu.ac.jp>
date Tue, 04 Jun 2013 17:15:27 +0900
parents dd1c78c6398f
children
line wrap: on
line source

#!/bin/bash
#
# Starts a basic web server on the port specified.
# 
# ./serve.sh 3000 -> http://localhost:3000
#
# Copyright 2012 Eric Bidelman <ebidel@gmail.com>

port=$1
if [ $#  -ne  1 ]
then
  port=8000
fi

if [ $(uname -s) == "Darwin" ]
then
  open=open
else
  open=xdg-open
fi

$open http://localhost:$port/template.html && python -m SimpleHTTPServer $port;