From 77d67a1569426745fe2324736adf8fd5e9aad0f7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 23 May 2018 21:31:52 +0100 Subject: [PATCH] Fix debian normalisation in postinst --- contrib/deb/generate.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/deb/generate.sh b/contrib/deb/generate.sh index 05850de5..bcc4750f 100644 --- a/contrib/deb/generate.sh +++ b/contrib/deb/generate.sh @@ -62,8 +62,11 @@ cat > /tmp/$PKGNAME/debian/postinst << EOF #!/bin/sh if [ -f /etc/yggdrasil.conf ]; then - cp /etc/yggdrasil.conf /etc/yggdrasil.conf.pre-upgrade - ./yggdrasil -useconffile /etc/yggdrasil.conf.pre-upgrade -normaliseconf > /etc/yggdrasil.conf; + mkdir -p /var/backups + echo "Backing up configuration file to /var/backups/yggdrasil.conf.`date +%Y%m%d`" + cp /etc/yggdrasil.conf /var/backups/yggdrasil.conf.`date +%Y%m%d` + echo "Normalising /etc/yggdrasil.conf" + /usr/bin/yggdrasil -useconffile /var/backups/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf fi systemctl enable yggdrasil systemctl start yggdrasil