5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 08:20:28 +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/ Please see https://github.com/Arceliar/yggdrasil-go/
EOF EOF
cat > /tmp/$PKGNAME/debian/install << 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 etc/systemd/system/*.service etc/systemd/system
EOF EOF
cat > /tmp/$PKGNAME/debian/postinst << EOF cat > /tmp/$PKGNAME/debian/postinst << EOF
#!/bin/sh #!/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 enable yggdrasil
systemctl start yggdrasil systemctl start yggdrasil
EOF EOF