mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-11 16:14:33 +02:00
[client] Improve NetBird installation script to handle daemon connection timeout (#3761)
[client] Improve NetBird installation script to handle daemon connection timeout
This commit is contained in:
@ -224,16 +224,22 @@ check_use_bin_variable() {
|
|||||||
|
|
||||||
install_netbird() {
|
install_netbird() {
|
||||||
if [ -x "$(command -v netbird)" ]; then
|
if [ -x "$(command -v netbird)" ]; then
|
||||||
status_output=$(netbird status)
|
status_output="$(netbird status 2>&1 || true)"
|
||||||
if echo "$status_output" | grep -q 'Management: Connected' && echo "$status_output" | grep -q 'Signal: Connected'; then
|
|
||||||
echo "NetBird service is running, please stop it before proceeding"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$status_output" ]; then
|
if echo "$status_output" | grep -q 'failed to connect to daemon error: context deadline exceeded'; then
|
||||||
echo "NetBird seems to be installed already, please remove it before proceeding"
|
echo "Warning: could not reach NetBird daemon (timeout), proceeding anyway"
|
||||||
exit 1
|
else
|
||||||
fi
|
if echo "$status_output" | grep -q 'Management: Connected' && \
|
||||||
|
echo "$status_output" | grep -q 'Signal: Connected'; then
|
||||||
|
echo "NetBird service is running, please stop it before proceeding"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$status_output" ]; then
|
||||||
|
echo "NetBird seems to be installed already, please remove it before proceeding"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run the installation, if a desktop environment is not detected
|
# Run the installation, if a desktop environment is not detected
|
||||||
|
Reference in New Issue
Block a user