HA Addon: fix config file check in entrypoint (#24972)
This commit is contained in:
parent
2f48158655
commit
5f14c02077
1 changed files with 3 additions and 3 deletions
|
|
@ -5,12 +5,12 @@ set -e
|
|||
HASSIO_OPTIONSFILE=/data/options.json
|
||||
|
||||
if [ -f ${HASSIO_OPTIONSFILE} ]; then
|
||||
CONFIG=$(grep -o '"config_file": "[^"]*' ${HASSIO_OPTIONSFILE} | grep -o '[^"]*$')
|
||||
SQLITE_FILE=$(grep -o '"sqlite_file": "[^"]*' ${HASSIO_OPTIONSFILE} | grep -o '[^"]*$')
|
||||
CONFIG=$(grep -o '"config_file": "[^"]*' ${HASSIO_OPTIONSFILE} | grep -o '[^"]*$' || true)
|
||||
SQLITE_FILE=$(grep -o '"sqlite_file": "[^"]*' ${HASSIO_OPTIONSFILE} | grep -o '[^"]*$' || true)
|
||||
|
||||
# Config File Migration
|
||||
# If there is no config file found in '/config' we copy it from '/homeassistant' and rename the old config file to .migrated
|
||||
if [ ! -f "${CONFIG}" ]; then
|
||||
if [ -n "${CONFIG}" ] && [ ! -f "${CONFIG}" ]; then
|
||||
CONFIG_OLD=$(echo "${CONFIG}" | sed 's#^/config#/homeassistant#')
|
||||
if [ -f "${CONFIG_OLD}" ]; then
|
||||
mkdir -p "$(dirname "${CONFIG}")" && cp "${CONFIG_OLD}" "${CONFIG}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue