[client] Restart netbird-ui post-install in linux deb&rpm (#2992)

This commit is contained in:
M. Essam
2025-02-21 20:39:12 +02:00
committed by GitHub
parent 73ce746ba7
commit 73101c8977
2 changed files with 14 additions and 0 deletions

View File

@@ -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) | sed 's/^[ \t]*//;s/[ \t]*$//')
# Only re-run if it was already running
pkill -x -f /usr/bin/netbird-ui >/dev/null 2>&1
su -l - "$runner" -c 'nohup /usr/bin/netbird-ui > /dev/null 2>&1 &'
fi