diff --git a/build.go b/build.go index b2166b3a..265172f1 100644 --- a/build.go +++ b/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()) } } diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 00000000..0289794c --- /dev/null +++ b/debian/postinst @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail + +if [[ ${1:-} == configure ]]; then + pkill -x -HUP syncthing || true +fi