mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Update 19-json_repair.sh
This commit is contained in:
@@ -12,7 +12,7 @@ if [ -f "${JSONTOCHECK}" ]; then
|
|||||||
|
|
||||||
# Check if json file valid or not
|
# Check if json file valid or not
|
||||||
jq . -S "${JSONTOCHECK}" &>/dev/null && ERROR=false || ERROR=true
|
jq . -S "${JSONTOCHECK}" &>/dev/null && ERROR=false || ERROR=true
|
||||||
if [ $ERROR = true ]; then
|
if [ "$ERROR" = true ]; then
|
||||||
bashio::log.fatal "Settings.json structure is abnormal, restoring options from scratch. Your old file is renamed as settings.json_old"
|
bashio::log.fatal "Settings.json structure is abnormal, restoring options from scratch. Your old file is renamed as settings.json_old"
|
||||||
mv "${JSONSOURCE}" "${JSONSOURCE}"_old
|
mv "${JSONSOURCE}" "${JSONSOURCE}"_old
|
||||||
cp "${JSONSOURCE}" "${JSONTOCHECK}"
|
cp "${JSONSOURCE}" "${JSONTOCHECK}"
|
||||||
|
|||||||
Reference in New Issue
Block a user