diff --git a/README.md b/README.md index 0cbb30a..fa1193b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,25 @@ If you just want to get running, you can use a pre-built chroot with the latest (~~Btw, the chroot is built nightly from master using Docker on a C1.~~ Manually built for now. See the [Makefile](Makefile.docker) for details.) +## Install as service using a pre-built chroot + +Grab the latest release from [Releases](https://github.com/Fornoth/spotify-connect-web/releases) + +If you want to install it as a service, install a pre-built chroot with the latest version installed. +### Installation instructions (example): + + curl -O curl -OL https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.3-alpha/spotify-connect-web.sh + chmod u+x spotify-connect-web.sh + # Download the current chroot (~ 180 MB) + sudo ./spotify-connect-web.sh install-system + # Copy your `spotify_appkey.key` into the app directory. (See below for information on how to get that file.) + sudo cp spotify_appkey.key /usr/local/lib/spotify-connect-web/usr/src/app/ + # Run once using normal cmdline options + sudo /usr/local/bin/spotify-connect-web.sh --username 12345678 --password xyz123 --bitrate 320 + # start service + sudo systemctl start spotify-connect + + ## Quickstart with Docker (You will have to use `sudo` if not logged in as root.) diff --git a/spotify-connect-web.sh b/spotify-connect-web.sh new file mode 100644 index 0000000..c92807d --- /dev/null +++ b/spotify-connect-web.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e + +DIR=~/spotify-connect-web-chroot +DIR_SYSTEM=/usr/local/lib/spotify-connect-web +DIR_SYSTEMD=/lib/systemd/system/ +NAME=rpi-server3 + +if [ "$1" == "install-system" ]; then + if [ "$(id -u)" != "0" ]; then + echo "For system wide install this script must be run as root (e.g. use sudo $0)" 1>&2 + exit 1 + fi + mkdir -p $DIR_SYSTEM + cd $DIR_SYSTEM + curl http://spotify-connect-web.s3-website.eu-central-1.amazonaws.com/spotify-connect-web.tar.gz | sudo tar xz + cp $0 $DIR_SYSTEM/../../bin/ + cat >/lib/systemd/system/spotify-connect.service <