#!/bin/bash set -e cd "$(dirname "$0")" echo "Building frontend..." make build echo "Building Go binary..." make build-go echo "Installing binary..." mkdir -p ~/go/bin tmp_target=~/go/bin/webterm.new cp bin/webterm "$tmp_target" chmod +x "$tmp_target" mv "$tmp_target" ~/go/bin/webterm echo "Restarting service..." systemctl --user restart webterm.service echo "Done. Status:" systemctl --user status webterm.service --no-pager echo echo "Listening sockets:" ss -ltnp | grep ':8080' || true echo echo "Reachable URLs:" echo " Local: http://127.0.0.1:8080/" hostname -I 2>/dev/null | tr ' ' '\n' | sed '/^$/d' | while read -r ip; do echo " LAN: http://$ip:8080/" done