diff --git a/scripts/on-device-install/install.sh b/scripts/on-device-install/install.sh index 29566df..1c2bf95 100644 --- a/scripts/on-device-install/install.sh +++ b/scripts/on-device-install/install.sh @@ -5,29 +5,31 @@ VERSION=${VERSION:-0.73.0} 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} +UPDATE_TMP_DIR=${UPDATE_TMP_DIR:-/media/aftertouch} -rm -rf /tmp/aftertouch || true -mkdir -p /tmp/aftertouch + +rm -rf "$UPDATE_TMP_DIR" || true +mkdir -p "$UPDATE_TMP_DIR" echo "Installing Aftertouch $VERSION ..." mkdir -p /opt/aftertouch curl \ -sSL \ - -o /tmp/aftertouch/binary \ + -o "$UPDATE_TMP_DIR/binary" \ --fail \ "$BINARY_URL" -mv /tmp/aftertouch/binary /opt/aftertouch/aftertouch-service +mv "$UPDATE_TMP_DIR/binary" /opt/aftertouch/aftertouch-service chmod +x /opt/aftertouch/aftertouch-service echo "Creating init script..." curl \ -sSL \ - -o /tmp/aftertouch/init-script \ + -o "$UPDATE_TMP_DIR/init-script" \ --fail \ "$INIT_SCRIPT_URL" -mv /tmp/aftertouch/init-script /etc/init.d/aftertouch +mv "$UPDATE_TMP_DIR/init-script" /etc/init.d/aftertouch chmod +x /etc/init.d/aftertouch update-rc.d aftertouch defaults