[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to rename^wremove a ucf-conffile?



Hi,

after Paul was so kind to show me some sample code to rename an
ucf-conffile, I am now faced with the task of deleting an ucf-conffile
with a package update.

My first (untested) approach would be:

FILENAME="/etc/foo/bar.conf"
if [ -e "$FILENAME" ]; then
  ucf --debconf-ok /dev/null $FILENAME
  if [ -s "$FILENAME" ]; then
    rm -f $FILENAME
  fi
fi
ucfr --purge $PKGNAME $FILENAME

That way, the user would get an ucf prompt to replace the file with an
empty file, and if she decides to do this, the file would be entirely
removed. If she decides to keep her non-empty file, it would remain on
the system. In any case, it would be deregistered from ucf.

Did I miss a case?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062


Reply to: