Browse Source

Fix linux package

世界 2 years ago
parent
commit
81e7b0b320
3 changed files with 9 additions and 0 deletions
  1. 3 0
      .goreleaser.yaml
  2. 3 0
      release/config/postinstall.sh
  3. 3 0
      release/config/postremove.sh

+ 3 - 0
.goreleaser.yaml

@@ -70,6 +70,9 @@ nfpms:
         dst: /etc/systemd/system/[email protected]
       - src: LICENSE
         dst: /usr/share/licenses/sing-box/LICENSE
+    scripts:
+      postinstall: release/config/postinstall.sh
+      postremove: release/config/postremove.sh
 source:
   enabled: false
   name_template: '{{ .ProjectName }}-{{ .Version }}.source'

+ 3 - 0
release/config/postinstall.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mkdir "/var/lib/sing-box"

+ 3 - 0
release/config/postremove.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rm -rf "/var/lib/sing-box"