From: Ray Strode Date: Wed, 24 Mar 2010 17:59:17 +0000 (-0400) Subject: [set-default-theme] properly handle commented out [Daemon] section X-Git-Tag: 0.8.1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91547048f8ce7e5118418924b122fd339fcdf369;p=thirdparty%2Fplymouth.git [set-default-theme] properly handle commented out [Daemon] section Before we would assume there was a valid [Daemon] section already if a comment contained [Daemon] in it. --- diff --git a/scripts/plymouth-set-default-theme.in b/scripts/plymouth-set-default-theme.in index 732f8ad2..00d01843 100755 --- a/scripts/plymouth-set-default-theme.in +++ b/scripts/plymouth-set-default-theme.in @@ -177,7 +177,7 @@ if [ ! -e ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so ]; then fi [ -d ${PLYMOUTH_CONFDIR} ] || mkdir -p ${PLYMOUTH_CONFDIR} -fgrep -q '[Daemon]' ${PLYMOUTH_CONFDIR}/plymouthd.conf 2> /null || echo '[Daemon]' >> ${PLYMOUTH_CONFDIR}/plymouthd.conf +grep -q '^[[]Daemon[]]' ${PLYMOUTH_CONFDIR}/plymouthd.conf 2> /null || echo '[Daemon]' >> ${PLYMOUTH_CONFDIR}/plymouthd.conf sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf sed -i -e "s/\([[]Daemon[]]\)\n*/\1\nTheme=${THEME_NAME}/" ${PLYMOUTH_CONFDIR}/plymouthd.conf