install.sh now sets the hostname (default radxa-mixer, --hostname or --keep-hostname to override) after a successful install so Avahi advertises NAME.local, and the web mixer listens on port 80. The web server's host check already accepts HOSTNAME.local. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.3 KiB
Bash
Executable File
29 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Install/update web tools on a board that already has Shairport Sync with D-Bus.
|
|
set -euo pipefail
|
|
PACKAGE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
[[ $EUID == 0 ]] || { echo 'sudo로 실행해 주세요.' >&2; exit 1; }
|
|
/usr/local/bin/shairport-sync -V | grep -qi dbus || { echo '먼저 AirPlay D-Bus 지원 빌드를 설치해 주세요.' >&2; exit 1; }
|
|
install -d -m 755 /usr/local/lib/radxa-mixer/web
|
|
install -m 755 "$PACKAGE_DIR/scripts/radxa-audio.py" /usr/local/bin/radxa-audio
|
|
install -m 755 "$PACKAGE_DIR/scripts/web_server.py" /usr/local/lib/radxa-mixer/web_server.py
|
|
install -m 644 "$PACKAGE_DIR/scripts/input_controls.py" /usr/local/lib/radxa-mixer/input_controls.py
|
|
install -m 644 "$PACKAGE_DIR/scripts/web/"* /usr/local/lib/radxa-mixer/web/
|
|
cat > /etc/systemd/system/radxa-mixer-web.service <<'UNIT'
|
|
[Unit]
|
|
Description=Radxa wireless audio mixer web interface
|
|
After=network.target bluetooth.service shairport-sync.service bluealsa.service
|
|
[Service]
|
|
ExecStart=/usr/bin/python3 /usr/local/lib/radxa-mixer/web_server.py --port 80
|
|
Restart=on-failure
|
|
RestartSec=3
|
|
UMask=0022
|
|
NoNewPrivileges=true
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
UNIT
|
|
systemctl daemon-reload
|
|
systemctl enable --now radxa-mixer-web
|
|
systemctl restart radxa-mixer-web
|
|
echo "웹 믹서: http://$(hostname).local 또는 http://보드IP"
|