Add postinst script to restart after upgrade

This commit is contained in:
Jakob Borg 2016-01-19 09:54:47 -08:00
parent 042b703fe4
commit 99372c69e5
2 changed files with 10 additions and 1 deletions

View File

@ -344,7 +344,8 @@ func buildDeb() {
if err != nil {
log.Fatal(err)
}
out, err := os.Create(filepath.Join("deb/DEBIAN", filepath.Base(file)))
outFile := filepath.Join("deb/DEBIAN", filepath.Base(file))
out, err := os.Create(outFile)
if err != nil {
log.Fatal(err)
}
@ -354,6 +355,8 @@ func buildDeb() {
if err := out.Close(); err != nil {
log.Fatal(err)
}
info, _ := os.Lstat(file)
os.Chmod(outFile, info.Mode())
}
}

6
debian/postinst vendored Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
if [[ ${1:-} == configure ]]; then
pkill -x -HUP syncthing || true
fi