5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-23 04:05:39 +00:00

Normalise existing yggdrasil.conf on debian package install/upgrade

This commit is contained in:
Neil Alexander 2018-05-23 13:26:08 +01:00
parent 34f7b7ca14
commit 8a46253c1f
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -54,11 +54,17 @@ cat > /tmp/$PKGNAME/debian/docs << EOF
Please see https://github.com/Arceliar/yggdrasil-go/
EOF
cat > /tmp/$PKGNAME/debian/install << EOF
usr/bin/yggdrasil usr/bin/yggdrasilctl usr/bin
usr/bin/yggdrasil usr/bin
usr/bin/yggdrasilctl usr/bin
etc/systemd/system/*.service etc/systemd/system
EOF
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;
fi
systemctl enable yggdrasil
systemctl start yggdrasil
EOF