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~56 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=febe0e6266ff6dc5f3d4de0062b3c55aefb1e424;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 ;;