Created
December 11, 2012 16:18
-
-
Save acepukas/4259927 to your computer and use it in GitHub Desktop.
easy_httpd_in_dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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