mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 00:26:29 +00:00
feat: Provide scripts and documentation for on-device install
This commit is contained in:
committed by
Tobias Gesellchen
parent
e3dac8b5a6
commit
370b587fcf
@@ -0,0 +1,48 @@
|
||||
# On-Device Installer
|
||||
|
||||
Allows to run AfterTouch on SoundTouch devices directly, eliminating the need to run and maintain a separate server on the local network.
|
||||
|
||||
|
||||
## Disclaimer
|
||||
|
||||
### Invasiveness
|
||||
|
||||
AfterTouch usually normally migrates the SoundTouch devices very noninvasive, by changing the configuration of the device. Running AfterTouch on the device itself is slightly more invasive, because it needs to create a script that starts AfterTouch on boot.
|
||||
|
||||
### AfterTouch Availability
|
||||
|
||||
Some devices will expose the AfterTouch port, some won't. We currently suspect that the newer generation devices (those with Bluetooth) will expose the port, while the older ones won't. We're still investigating how to expose AfterTouch on all devices.
|
||||
|
||||
If your device doesn't expose the port, you can still use the on-device installer, but you'll need to run AfterTouch on each one of your speakers individually and may only access AfterTouch via ssh port forwarding. This will also make OAuth authentication a little more tricky, but should also work via SSH port forwarding.
|
||||
|
||||
## Installation
|
||||
|
||||
Enable SSH on your SoundTouch device using the usual "Stick with remote_services" method. Connect with the following command.
|
||||
|
||||
```bash
|
||||
ssh -oHostKeyAlgorithms=+ssh-rsa root@<IP_ADDRESS_OF_SPEAKER>
|
||||
```
|
||||
|
||||
Then, run the following command to install AfterTouch on the device.
|
||||
|
||||
```bash
|
||||
curl -sSL https://raw.githubusercontent.com/gesellix/Bose-SoundTouch/main/scripts/on-device-install/install.sh | sh
|
||||
```
|
||||
|
||||
After the installation check if you can access AfterTouch from your local device by navigating to `http://<IP_ADDRESS_OF_SPEAKER>:8000`. If you can access the AfterTouch UI, you're good to go! If not, you may need to run AfterTouch on the speaker via SSH port forwarding.
|
||||
|
||||
```bash
|
||||
ssh -L 8000:localhost:8000 root@<IP_ADDRESS_OF_SPEAKER>
|
||||
```
|
||||
|
||||
## Updating AfterTouch
|
||||
|
||||
To update AfterTouch, simply run the installation command again. The installer will check if there's a new version available and update it if necessary.
|
||||
|
||||
## Uninstallation
|
||||
|
||||
To uninstall AfterTouch, run the following command on the speaker.
|
||||
|
||||
```bash
|
||||
curl -sSL https://raw.githubusercontent.com/gesellix/Bose-SoundTouch/main/scripts/on-device-install/uninstall.sh | sh
|
||||
```
|
||||
@@ -0,0 +1,105 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: soundtouch-service
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop: $network $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Run AfterTouch on this device
|
||||
# Description: Start/stop AfterTouch soundtouch-service
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
NAME="aftertouch-service"
|
||||
DESC="Bose AfterTouch service"
|
||||
DAEMON="/opt/aftertouch/aftertouch-service"
|
||||
PIDFILE="/var/run/$NAME.pid"
|
||||
DATADIR="/opt/aftertouch/data"
|
||||
SCRIPTNAME="/etc/init.d/$NAME"
|
||||
USER="root"
|
||||
|
||||
|
||||
# Export PATH
|
||||
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
|
||||
|
||||
# Sanity check executable
|
||||
test -x "$DAEMON" || {
|
||||
echo "ERROR: Cannot execute $DAEMON (check path and permissions)." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting $DESC..."
|
||||
|
||||
mount -o remount,rw / >/dev/null 2>&1 || {
|
||||
echo "ERROR: remount failed." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
mkdir -p "$DATADIR"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--quiet \
|
||||
--pidfile "$PIDFILE" \
|
||||
--background \
|
||||
--make-pidfile \
|
||||
--chuid "$USER" \
|
||||
--startas "/bin/sh" \
|
||||
-- -c "\"$DAEMON\" --data-dir '$DATADIR' --record-interactions=false"
|
||||
|
||||
tries=0
|
||||
max_tries=60
|
||||
while [ $tries -lt $max_tries ]; do
|
||||
if curl -fsS http://localhost:8000 >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
sleep 2
|
||||
tries=$((tries + 1))
|
||||
done
|
||||
|
||||
exit 1
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "Stopping $DESC..."
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
start-stop-daemon --stop \
|
||||
--quiet \
|
||||
--oknodo \
|
||||
--pidfile "$PIDFILE"
|
||||
rm -f "$PIDFILE"
|
||||
else
|
||||
echo "No $NAME running (no PID file)." >&2
|
||||
fi
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
"$0" stop
|
||||
sleep 2
|
||||
"$0" start
|
||||
;;
|
||||
|
||||
status)
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
PID=$(cat "$PIDFILE")
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
echo "$NAME is running."
|
||||
else
|
||||
echo "$NAME is not running (PID file exists but process is dead)."
|
||||
fi
|
||||
else
|
||||
echo "$NAME is not running."
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
VERSION=${VERSION:-0.71.2}
|
||||
GH_REPO=${GH_REPO:-gesellix/Bose-SoundTouch}
|
||||
BINARY_URL=${BINARY_URL:-https://github.com/$GH_REPO/releases/download/v$VERSION/soundtouch-service-v$VERSION-linux-armv7}
|
||||
INIT_SCRIPT_URL=${INIT_SCRIPT_URL:-https://raw.githubusercontent.com/$GH_REPO/v$VERSION/scripts/on-device-install/aftertouch}
|
||||
|
||||
echo "Installing Aftertouch $VERSION for ARMv7..."
|
||||
mkdir -p /opt/aftertouch
|
||||
cd /opt/aftertouch
|
||||
curl \
|
||||
-sSL \
|
||||
-O \
|
||||
"$BINARY_URL"
|
||||
|
||||
mv soundtouch-service-v$VERSION-linux-armv7 aftertouch-service
|
||||
chmod +x aftertouch-service
|
||||
|
||||
echo "Creating init script..."
|
||||
cd /etc/init.d
|
||||
curl \
|
||||
-sSL \
|
||||
-O \
|
||||
"$INIT_SCRIPT_URL"
|
||||
|
||||
chmod +x aftertouch
|
||||
update-rc.d aftertouch defaults
|
||||
|
||||
echo "Installation complete. Running initial startup to accelerate future startups..."
|
||||
/etc/init.d/aftertouch start
|
||||
|
||||
/etc/init.d/aftertouch status
|
||||
|
||||
echo "Installation complete. Aftertouch $VERSION is now running on your device."
|
||||
echo "You can try to connect to at http://<your-device-ip>:8000 ."
|
||||
echo "If the connection fails, reconnect ssh with port forwarding like:"
|
||||
echo "ssh -L 8000:localhost:8000 root@<IP_ADDRESS_OF_SPEAKER>"
|
||||
@@ -0,0 +1,4 @@
|
||||
/etc/init.d/aftertouch stop
|
||||
rm -rf /etc/init.d/aftertouch
|
||||
run update-rc.d -f aftertouch remove
|
||||
rm -rf /opt/aftertouch
|
||||
Reference in New Issue
Block a user