#!/bin/bash
pkill -f "http.server 8088" 2>/dev/null
sleep 1
cd "$HOME/mpbox" || exit 1
nohup python3 -m http.server 8088 --bind 127.0.0.1 >/tmp/onboard-http.log 2>&1 &
sleep 2
echo "local wifi-setup.html http code: $(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8088/wifi-setup.html)"
echo "serving from: $HOME/mpbox"
ls -la "$HOME/mpbox/wifi-setup.html"
# funnel уже поднят на :443->8088, не трогаем
tailscale funnel status 2>&1 | grep -i 'funnel on\|mp-box'
