Add postinst script to restart after upgrade
This commit is contained in:
parent
042b703fe4
commit
99372c69e5
5
build.go
5
build.go
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ ${1:-} == configure ]]; then
|
||||
pkill -x -HUP syncthing || true
|
||||
fi
|
Loading…
Reference in New Issue