From 0058b99dd354acf4d7293571da4e84fe96d83beb Mon Sep 17 00:00:00 2001 From: M Essam Hamed Date: Thu, 5 Dec 2024 16:22:00 +0200 Subject: [PATCH] Restart netbird-ui post-install in linux deb&rpm --- .goreleaser_ui.yaml | 4 ++++ release_files/ui-post-install.sh | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 release_files/ui-post-install.sh diff --git a/.goreleaser_ui.yaml b/.goreleaser_ui.yaml index 06577f4e3c3..252cf320c73 100644 --- a/.goreleaser_ui.yaml +++ b/.goreleaser_ui.yaml @@ -50,6 +50,8 @@ nfpms: - netbird-ui formats: - deb + scripts: + postinstall: "release_files/ui-post-install.sh" contents: - src: client/ui/netbird.desktop dst: /usr/share/applications/netbird.desktop @@ -67,6 +69,8 @@ nfpms: - netbird-ui formats: - rpm + scripts: + postinstall: "release_files/ui-post-install.sh" contents: - src: client/ui/netbird.desktop dst: /usr/share/applications/netbird.desktop diff --git a/release_files/ui-post-install.sh b/release_files/ui-post-install.sh new file mode 100644 index 00000000000..8b0099af3cb --- /dev/null +++ b/release_files/ui-post-install.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +pkill -x -f /usr/bin/netbird-ui # Kill current running netbird-ui (if exists) +if [[ "$?" = "0" ]] # Only re-run if it was already running +then + nohup /usr/bin/netbird-ui > /dev/null &disown +fi