#!/bin/sh
#
MY_MANUAL="manual # PLYMOUTH_DISABLER"
MY_MANUAL_REGEX="manual[ 	]\+#[ 	]*PLYMOUTH_DISABLER"
# dpkg -L plymouth | sed -n -e 's,.conf$,,' -e 's,/etc/init/,,p' | sort
PLYMOUTH_JOBS="plymouth plymouth-log plymouth-ready plymouth-splash
   plymouth-stop plymouth-upstart-bridge"

set -e

if [ "$1" = "remove" -o "$1" = "purge" ]; then
   for job in $PLYMOUTH_JOBS; do
      cfg="/etc/init/$job.conf.override"
      [ -f "$cfg" ] || continue
      # remove the 'manual' entry that we added.
      sed -i "/${MY_MANUAL_REGEX}/d" "$cfg"
      # if .override is now empty, remove it.
      [ -s "$cfg" ] || rm -f "$cfg"
   done
fi

#DEBHELPER#
