Skip to content

Commit

Permalink
Restart netbird-ui post-install in linux deb&rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-essam committed Dec 10, 2024
1 parent 713e320 commit 441432a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .goreleaser_ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 10 additions & 0 deletions release_files/ui-post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# Check if netbird-ui is running
if pgrep -x -f /usr/bin/netbird-ui >/dev/null 2>&1;
then
runner=$(ps --no-headers -o '%U' -p $(pgrep -x -f /usr/bin/netbird-ui))
# Only re-run if it was already running
pkill -x -f /usr/bin/netbird-ui >/dev/null 2>&1
runuser -u "$runner" nohup /usr/bin/netbird-ui > /dev/null &
fi

0 comments on commit 441432a

Please sign in to comment.