From: Sebastian Harl Date: Tue, 1 May 2007 21:10:42 +0000 (+0200) Subject: collectd.postinst: Pass hostname to migrate-3-4.px and fix new DataDir. X-Git-Tag: collectd-4.0.2-1~52 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d99087916aa7ba49bbfcfd2136e3dc39540e3e5c;p=pkg-collectd.git collectd.postinst: Pass hostname to migrate-3-4.px and fix new DataDir. * hostname should only default to "localhost" if hostname(1) returned the empty string * move new DataDir to /var/lib/collectd/rrd instead of /var/lib/collectd/ --- diff --git a/debian/collectd.postinst b/debian/collectd.postinst index 82cfa51..b9b5b14 100755 --- a/debian/collectd.postinst +++ b/debian/collectd.postinst @@ -24,12 +24,17 @@ case "$1" in db_get collectd/auto-migrate-3-4 if [ "$RET" = "true" ]; then tmpdir=`mktemp -dt collectd.XXXXXXXXXX` + hostname=`hostname` + + if [ -z "$hostname" ]; then hostname="localhost"; fi cp -a /var/lib/collectd/ /var/backups/collectd-"$2" - /usr/lib/collectd/utils/migrate-3-4.px -o $tmpdir | bash + /usr/lib/collectd/utils/migrate-3-4.px \ + --hostname="$hostname" --outdir="$tmpdir" | bash rm -rf /var/lib/collectd/ - mv $tmpdir /var/lib/collectd/ + mkdir /var/lib/collectd/ + mv $tmpdir /var/lib/collectd/rrd fi ;;