mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-03 22:34:11 +02:00
Update 19-json_repair.sh
This commit is contained in:
@@ -26,7 +26,7 @@ if [ -f ${JSONTOCHECK} ]; then
|
|||||||
KEYSTHERE=$(jq "has(\"${KEYS}\")" ${JSONTOCHECK})
|
KEYSTHERE=$(jq "has(\"${KEYS}\")" ${JSONTOCHECK})
|
||||||
if [ $KEYSTHERE != "true" ]; then
|
if [ $KEYSTHERE != "true" ]; then
|
||||||
#Fetch initial value
|
#Fetch initial value
|
||||||
JSONSOURCEVALUE=$(jq -r .${KEYS} ${JSONSOURCE})
|
JSONSOURCEVALUE=$(jq -r ".\"$KEYS\"" ${JSONSOURCE})
|
||||||
#Add key
|
#Add key
|
||||||
sed -i "3 i\"${KEYS}\": \"${JSONSOURCEVALUE}\"}," ${JSONTOCHECK}
|
sed -i "3 i\"${KEYS}\": \"${JSONSOURCEVALUE}\"}," ${JSONTOCHECK}
|
||||||
# Message
|
# Message
|
||||||
|
|||||||
Reference in New Issue
Block a user