I am trying to automate a setup. One of the steps involves modifying guisettings.xml. Somehow this file is overwritten at startup.
I have read in the kodi forums that kodi writes this file at shuitdown. So I stop mediacenter, write the file and start mediacenter. But somehow guisettings.xml is overwritten at statup. The setting is again at the previous value and the timestamp of the file is at startup time.
This script:
systemctl stop mediacenter
file="/home/osmc/.kodi/userdata/guisettings.xml"
search="<setting id=\"addons.unknownsources\" default=\"true\">false"
replace="<setting id=\"addons.unknownsources\" default=\"true\">true"
sed -i "s/$search/$replace/g" $file
grep addons.unknownsources $file
systemctl start mediacenter
sleep 5
grep addons.unknownsources $file
Outputs:
<setting id="addons.unknownsources" default="true">true</setting>
<setting id="addons.unknownsources" default="true">false</setting>
How can I change values in guisettings.xml with a script?