Added parsing of XML entities when reading the OpenELEC configuration file. Allows the use of quotes and other special characters on WLAN passphrases, for example.

This commit is contained in:
Joan Coll Cerdán 2012-04-09 17:56:43 +02:00
parent e2cb82c54b
commit 730c0f5602

View File

@ -26,8 +26,10 @@
OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml"
if [ -f "$OPENELEC_SETTINGS" ]; then
progress "creating system settings"
progress "creating system settings"
mkdir -p /var/config
cat "$OPENELEC_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/settings.conf
cat "$OPENELEC_SETTINGS" \
| awk -F'[\"|'\'']' '{gsub(/\&quot\;/, "\\\"", $4); gsub(/\&apos\;/, "\047", $4); gsub(/\&amp\;/, "&", $4); gsub(/\&lt\;/, "<", $4); gsub(/\&gt\;/, ">", $4); print $2"=\""$4"\"";}' \
| sed '/^=/d' > /var/config/settings.conf
fi