From 92d34bef40e99815b2c171a43d4b572161b8849e Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Tue, 14 May 2024 16:18:08 +0300 Subject: [PATCH 1/3] add installer support for the synology --- release_files/install.sh | 75 ++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/release_files/install.sh b/release_files/install.sh index a0a9abf9880..b3d065d5c4c 100755 --- a/release_files/install.sh +++ b/release_files/install.sh @@ -349,39 +349,54 @@ fi if type uname >/dev/null 2>&1; then case "$(uname)" in Linux) - OS_NAME="$(. /etc/os-release && echo "$ID")" - OS_TYPE="linux" - INSTALL_DIR="/usr/bin" - - # Allow netbird UI installation for x64 arch only - if [ "$ARCH" != "amd64" ] && [ "$ARCH" != "arm64" ] \ - && [ "$ARCH" != "x86_64" ];then - SKIP_UI_APP=true - echo "NetBird UI installation will be omitted as $ARCH is not a compatible architecture" + OS_TYPE="linux" + UNAME_OUTPUT="$(uname -a)" + if echo "$UNAME_OUTPUT" | grep -qi "synology"; then + OS_NAME="synology" + INSTALL_DIR="/usr/local/bin" + PACKAGE_MANAGER="bin" + else + if [ -f /etc/os-release ]; then + OS_NAME="$(. /etc/os-release && echo "$ID")" + INSTALL_DIR="/usr/bin" + + # Allow netbird UI installation for x64 arch only + if [ "$ARCH" != "amd64" ] && [ "$ARCH" != "arm64" ] \ + && [ "$ARCH" != "x86_64" ];then + SKIP_UI_APP=true + echo "NetBird UI installation will be omitted as $ARCH is not a compatible architecture" + fi + + # Allow netbird UI installation for linux running desktop environment + if [ -z "$XDG_CURRENT_DESKTOP" ];then + SKIP_UI_APP=true + echo "NetBird UI installation will be omitted as Linux does not run desktop environment" + fi + + # Check the availability of a compatible package manager + if check_use_bin_variable; then + PACKAGE_MANAGER="bin" + elif [ -x "$(command -v apt)" ]; then + PACKAGE_MANAGER="apt" + echo "The installation will be performed using apt package manager" + elif [ -x "$(command -v dnf)" ]; then + PACKAGE_MANAGER="dnf" + echo "The installation will be performed using dnf package manager" + elif [ -x "$(command -v yum)" ]; then + PACKAGE_MANAGER="yum" + echo "The installation will be performed using yum package manager" + elif [ -x "$(command -v pacman)" ]; then + PACKAGE_MANAGER="pacman" + echo "The installation will be performed using pacman package manager" + fi + + else + echo "Unable to determine OS type from /etc/os-release" + exit 1 fi + fi - # Allow netbird UI installation for linux running desktop environment - if [ -z "$XDG_CURRENT_DESKTOP" ];then - SKIP_UI_APP=true - echo "NetBird UI installation will be omitted as Linux does not run desktop environment" - fi - # Check the availability of a compatible package manager - if check_use_bin_variable; then - PACKAGE_MANAGER="bin" - elif [ -x "$(command -v apt)" ]; then - PACKAGE_MANAGER="apt" - echo "The installation will be performed using apt package manager" - elif [ -x "$(command -v dnf)" ]; then - PACKAGE_MANAGER="dnf" - echo "The installation will be performed using dnf package manager" - elif [ -x "$(command -v yum)" ]; then - PACKAGE_MANAGER="yum" - echo "The installation will be performed using yum package manager" - elif [ -x "$(command -v pacman)" ]; then - PACKAGE_MANAGER="pacman" - echo "The installation will be performed using pacman package manager" - fi ;; Darwin) OS_NAME="macos" From a93fe562d1b03f2937d111eee1233513db43e5af Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Tue, 14 May 2024 16:44:15 +0300 Subject: [PATCH 2/3] skip ui installation for Synology --- release_files/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release_files/install.sh b/release_files/install.sh index b3d065d5c4c..2b135d2497c 100755 --- a/release_files/install.sh +++ b/release_files/install.sh @@ -355,6 +355,7 @@ if type uname >/dev/null 2>&1; then OS_NAME="synology" INSTALL_DIR="/usr/local/bin" PACKAGE_MANAGER="bin" + SKIP_UI_APP=true else if [ -f /etc/os-release ]; then OS_NAME="$(. /etc/os-release && echo "$ID")" From 31a69800491b1557f78acb3b7c3fdee9b60e5e4e Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Wed, 15 May 2024 18:09:26 +0300 Subject: [PATCH 3/3] Fix conflicts --- release_files/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_files/install.sh b/release_files/install.sh index 2b135d2497c..198d7442885 100755 --- a/release_files/install.sh +++ b/release_files/install.sh @@ -377,7 +377,7 @@ if type uname >/dev/null 2>&1; then # Check the availability of a compatible package manager if check_use_bin_variable; then PACKAGE_MANAGER="bin" - elif [ -x "$(command -v apt)" ]; then + elif [ -x "$(command -v apt-get)" ]; then PACKAGE_MANAGER="apt" echo "The installation will be performed using apt package manager" elif [ -x "$(command -v dnf)" ]; then