Skip to content

Commit

Permalink
If nulls get into the settings file somehow, fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Jul 26, 2022
1 parent 856c3f7 commit 6633abd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ getSetting() {
SETTING=$1
if [ -f "${CFGFILE}" ]
then
grep -i "^${SETTING}\s*=.*" ${CFGFILE} | sed -e "s/.*=\s*//" -e 's/"//g'
grep -i --binary-files=text "^${SETTING}\s*=.*" ${CFGFILE} | sed -e "s/.*=\s*//" -e 's/"//g'
fi
}

Expand All @@ -163,5 +163,6 @@ setSetting() {
sed -i -e "/^${SETTING} *= *\"/d" ${CFGFILE}
fi
echo "${SETTING} = \"${VALUE}\"" >> ${CFGFILE}
sed -i 's/\x0//g' ${CFGFILE}
fi
}

0 comments on commit 6633abd

Please sign in to comment.