]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[set-default-theme] properly handle commented out [Daemon] section
authorRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 17:59:17 +0000 (13:59 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 17:59:17 +0000 (13:59 -0400)
Before we would assume there was a valid [Daemon] section already
if a comment contained [Daemon] in it.

scripts/plymouth-set-default-theme.in

index 732f8ad24dd59c79349b7e3c15557674b4258653..00d018434b63887e0563c3ac1ecc5b2507df8d50 100755 (executable)
@@ -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