Re: moving a config file
On Mon, Oct 21, 2002 at 16:41:01 +0200, Oliver Kurth wrote:
> #!/bin/sh -e
>
> ##$DEBIAN_SCRIPT_DEBUG || set -v -x
>
> if [ "$1" = "upgrade" ] ; then
> if dpkg --compare-versions "$2" lt "0.1.6-1" ; then
>
> # move config file to new location
> if [ -e /etc/masqmail.conf ]; then
> if [ ! -d /etc/masqmail ]; then
> mkdir /etc/masqmail
> mv -f /etc/masqmail.conf /etc/masqmail/
> fi
> fi
> fi
> fi
Is it idempotent? This may be a theoretical example, but consider CTRL+C
after the mkdir line, the mv will never happen then. Also '-f' shouldn't
be needed since /etc/masqmail should be empty.
Martin
Reply to: