#!/bin/sh

# Look for ifconfig
[ -e "/sbin/ifconfig" ] && CMD="/sbin/ifconfig"
[ -e "$(which ifconfig)" ] && CMD="ifconfig"
[ -n "$CMD" ] || error "ifconfig not found"

# Use ifconfig to get ip address
ADDR="$($CMD | grep -o '192\.168\.[0-9]*\.[0-9]*' | head -n 1)"

python -m http.server -b "$ADDR"