writesetting: Allow use of /

This commit is contained in:
MatMoul 2024-03-16 22:47:34 +01:00
parent e314382760
commit 062d16f0ea

View File

@ -36,7 +36,7 @@ readSetting() { # $1=filename $2=name $3=defaultvalue
writeSetting() { #$1=filename $2=valuename $3=value writeSetting() { #$1=filename $2=valuename $3=value
local -r LINE=$(grep "^${2}=" "${1}") local -r LINE=$(grep "^${2}=" "${1}")
if [ "${LINE}" != "" ]; then if [ "${LINE}" != "" ]; then
sed -i "s/^${2}=.*/${2}=${3}/" "${1}" sed -i "s/^${2}=.*/${2}=${3//\//\\\/}/" "${1}"
else else
echo "${2}=${3}" >> "${1}" echo "${2}=${3}" >> "${1}"
fi fi