well, I can do the complete script for you. That's not the problem. But it won't be 100% complete as I
1. don't know the skin name you want to delete the settings for
2. don't know the URL you want to download the settings file from
Downloading something while using the shutdown.sh script might fail, because the network-service is terminated before the shutdown.sh script is executed (or at least it's terminated pretty soon). I said "might" fail, because I'm simply not sure if that's still the case. Anyway, the shutdown process won't wait until the download has finished. I know, it's only a little file and normally it should be done within a little moment...but still...it might either fail because the network-service is terminated or the shutdown process will be done before the download will be finished. I will add the command to the script, just to show you how it might look like, but don't expect it to work.
Generally the script could look like:
bash:
case "$1" in
halt)
# your commands here
;;
poweroff)
#this will delete the settings.xml file
rm -f /storage/.kodi/userdata/addon_data/<skin.name.of.skin>/settings.xml
#this will download a settings.xml file and place it at the specific folder. Note: the URL should point directly to the file (settings.xml). Otherwise the "-P" won't work!!
wget <URL/you/want/to/download/settings.xml> -P /storage/.kodi/userdata/addon_data/<skin.name.of.skin>/
;;
reboot)
# your commands here
;;
*)
# your commands here
;;
esac
You have to replace
<skin.name.of.skin>
with the ID of the current skin and
<URL/you/want/to/download/settings.xml>
with the URL you want to download the settings.xml file from. Also be aware that you don't need the
<>
. Those are only placeholders in that example.
If the above doesn't work for the download, then you could try the `autostart.sh` script which LibreELEC is also able to use. That should be executed before Kodi starts. The
wget
-command will be the same. See here for an example for the autostart.sh script:
https://libreelec.wiki/autostart.sh
Good luck.