mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-12 22:02:43 +01:00
11 lines
372 B
Bash
11 lines
372 B
Bash
#!/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
|