From: Sebastian Harl Date: Mon, 30 Apr 2007 16:10:03 +0000 (+0200) Subject: collectd.postinst: Set output directory for migrate-3-4.px using mktemp(1). X-Git-Tag: collectd-4.0.2-1~45^2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7b428718d247cbd480a35080820eb3e31e719fc1;p=pkg-collectd.git collectd.postinst: Set output directory for migrate-3-4.px using mktemp(1). --- diff --git a/debian/collectd.postinst b/debian/collectd.postinst index 6a2357f..82cfa51 100755 --- a/debian/collectd.postinst +++ b/debian/collectd.postinst @@ -23,10 +23,13 @@ case "$1" in configure) db_get collectd/auto-migrate-3-4 if [ "$RET" = "true" ]; then + tmpdir=`mktemp -dt collectd.XXXXXXXXXX` + cp -a /var/lib/collectd/ /var/backups/collectd-"$2" - /usr/lib/collectd/utils/migrate-3-4.px | bash + /usr/lib/collectd/utils/migrate-3-4.px -o $tmpdir | bash + rm -rf /var/lib/collectd/ - mv /tmp/collectd-4/ /var/lib/collectd/ + mv $tmpdir /var/lib/collectd/ fi ;;