We also don't need to sed twice.

This commit is contained in:
fewtarius 2022-03-20 15:58:41 -04:00
parent b7cfd408f7
commit 42338a48e4
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -20,12 +20,12 @@ get_setting() {
} }
set_setting() { set_setting() {
sed -i "/^$1=/d" "${J_CONF}"
if [ "$2" == "disable" ] if [ "$2" == "disable" ]
then then
sed -i "/^#$1=/d" "${J_CONF}" sed -i "/^#$1=/d" "${J_CONF}"
echo "#${1}=" >> "${J_CONF}" echo "#${1}=" >> "${J_CONF}"
else else
sed -i "/^$1=/d" "${J_CONF}"
echo "${1}=${2}" >> "${J_CONF}" echo "${1}=${2}" >> "${J_CONF}"
fi fi
} }