From 730c0f560224ba51c4fe4a3f46d381935998645f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Coll=20Cerd=C3=A1n?= Date: Mon, 9 Apr 2012 17:56:43 +0200 Subject: [PATCH] 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. --- packages/sysutils/busybox/init.d/06_systemconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/sysutils/busybox/init.d/06_systemconfig b/packages/sysutils/busybox/init.d/06_systemconfig index b1808cab8e..1120b6c770 100644 --- a/packages/sysutils/busybox/init.d/06_systemconfig +++ b/packages/sysutils/busybox/init.d/06_systemconfig @@ -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(/\"\;/, "\\\"", $4); gsub(/\&apos\;/, "\047", $4); gsub(/\&\;/, "&", $4); gsub(/\<\;/, "<", $4); gsub(/\>\;/, ">", $4); print $2"=\""$4"\"";}' \ + | sed '/^=/d' > /var/config/settings.conf fi