You've already forked supervised-installer
mirror of
https://github.com/armbian/supervised-installer.git
synced 2026-01-06 12:31:12 -08:00
Use /var/lib/homeassistant as Supervisor data directory (#397)
* Use /var/lib/homeassistant as Supervisor data directory Instead of using /usr/share/hassio use /var/lib/homeassistant as Supervisor data directory. While the Supervisor data directory is a mixed bag of user and somewhat static files, /var/lib seems the better fit than /usr/local. Fixes: #393 * Handle upgrade correctly
This commit is contained in:
@@ -92,7 +92,7 @@ apt install ./homeassistant-supervised.deb
|
||||
|
||||
## Configuration
|
||||
|
||||
The default path for our `$DATA_SHARE` is `/usr/share/hassio`.
|
||||
The default path for our `$DATA_SHARE` is `/var/lib/homeassistant` (used to be `/usr/share/hassio`).
|
||||
This path is used to store all home assistant related things.
|
||||
|
||||
You can reconfigure this path during installation with
|
||||
|
||||
@@ -118,10 +118,18 @@ case ${ARCH} in
|
||||
error "${ARCH} unknown!"
|
||||
;;
|
||||
esac
|
||||
|
||||
PREFIX=${PREFIX:-/usr}
|
||||
SYSCONFDIR=${SYSCONFDIR:-/etc}
|
||||
DATA_SHARE=${DATA_SHARE:-$PREFIX/share/hassio}
|
||||
DEFAULT_DATA_SHARE=/var/lib/homeassistant
|
||||
DATA_SHARE=${DATA_SHARE:-$DEFAULT_DATA_SHARE}
|
||||
CONFIG="${SYSCONFDIR}/hassio.json"
|
||||
|
||||
if [ -f "${CONFIG}" ]; then
|
||||
# Using data share of existing configuration
|
||||
DATA_SHARE=$(jq -r --arg default "$DEFAULT_DATA_SHARE" '.data // $default' "$CONFIG")
|
||||
fi
|
||||
|
||||
cat > "${CONFIG}" <<- EOF
|
||||
{
|
||||
"supervisor": "${HASSIO_DOCKER}",
|
||||
|
||||
@@ -5,7 +5,7 @@ set -e
|
||||
CONFIG_FILE=%%HASSIO_CONFIG%%
|
||||
|
||||
# Read configs
|
||||
DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
|
||||
DATA="$(jq --raw-output '.data // "/var/lib/homeassistant"' ${CONFIG_FILE})"
|
||||
PROFILES_DIR="${DATA}/apparmor"
|
||||
CACHE_DIR="${PROFILES_DIR}/cache"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ set -e
|
||||
CONFIG_FILE=%%HASSIO_CONFIG%%
|
||||
|
||||
# Init supervisor
|
||||
SUPERVISOR_DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
|
||||
SUPERVISOR_DATA="$(jq --raw-output '.data // "/var/lib/homeassistant"' ${CONFIG_FILE})"
|
||||
SUPERVISOR_STARTUP_MARKER="/run/supervisor/startup-marker"
|
||||
SUPERVISOR_STARTSCRIPT_VERSION="${SUPERVISOR_DATA}/supervisor-version"
|
||||
SUPERVISOR_MACHINE="$(jq --raw-output '.machine' ${CONFIG_FILE})"
|
||||
@@ -110,4 +110,4 @@ fi
|
||||
mkdir -p ${SUPERVISOR_DATA}
|
||||
echo "[INFO] Starting the Supervisor..."
|
||||
docker container start hassio_supervisor
|
||||
exec docker container wait hassio_supervisor
|
||||
exec docker container wait hassio_supervisor
|
||||
|
||||
Reference in New Issue
Block a user