Skip to content

Instantly share code, notes, and snippets.

@acepukas
Created December 11, 2012 16:18
Show Gist options
  • Save acepukas/4259927 to your computer and use it in GitHub Desktop.
Save acepukas/4259927 to your computer and use it in GitHub Desktop.
easy_httpd_in_dir
#!/bin/sh
if [ -z $2 ]; then
PORT=8000
else
PORT=$2
fi
PIDFILE=/tmp/mini-httpd.pid
case "$1" in
start)
mini-httpd -p $PORT -i $PIDFILE
;;
stop)
kill -9 `cat $PIDFILE`
;;
*)
echo "usage: {start [port]|stop}"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment