#!/bin/bash
# To be used to call Python's simple HTTP server.
localip=$(ifconfig | grep -e addr: | grep -e Bcast | awk '{print $2}'| awk -F ":" '{print $2}')
echo "This script will start a webserver at"
echo "$localip on port 8000 showing"
echo "$PWD. Do you want to continue [y/N]?"
read CHOICE
case "$CHOICE" in
[Yy]*)
notify-send --icon=notification-network-wireless-full "Serving $PWD on port 8000"
python -m SimpleHTTPServer
notify-send --icon=notification-network-wireless-disconnected "Stopped sharing $PWD"
;;
*)
;;
esac