mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -354,6 +355,8 @@ func buildDeb() {
|
|||||||
if err := out.Close(); err != nil {
|
if err := out.Close(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
info, _ := os.Lstat(file)
|
||||||
|
os.Chmod(outFile, info.Mode())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
debian/postinst
vendored
Executable file
6
debian/postinst
vendored
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ ${1:-} == configure ]]; then
|
||||||
|
pkill -x -HUP syncthing || true
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user