Add script for loading tun module for synology (#2423)

This commit is contained in:
pascal-fischer 2024-08-20 11:46:58 +02:00 committed by GitHub
parent 049b5fb7ed
commit d2b04922e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -151,6 +151,22 @@ add_aur_repo() {
${SUDO} pacman -Rs "$REMOVE_PKGS" --noconfirm ${SUDO} pacman -Rs "$REMOVE_PKGS" --noconfirm
} }
prepare_tun_module() {
# Create the necessary file structure for /dev/net/tun
if [ ! -c /dev/net/tun ]; then
if [ ! -d /dev/net ]; then
mkdir -m 755 /dev/net
fi
mknod /dev/net/tun c 10 200
chmod 0755 /dev/net/tun
fi
# Load the tun module if not already loaded
if ! lsmod | grep -q "^tun\s"; then
insmod /lib/modules/tun.ko
fi
}
install_native_binaries() { install_native_binaries() {
# Checks for supported architecture # Checks for supported architecture
case "$ARCH" in case "$ARCH" in
@ -268,6 +284,10 @@ install_netbird() {
;; ;;
esac esac
if [ "$OS_NAME" = "synology" ]; then
prepare_tun_module
fi
# Add package manager to config # Add package manager to config
${SUDO} mkdir -p "$CONFIG_FOLDER" ${SUDO} mkdir -p "$CONFIG_FOLDER"
echo "package_manager=$PACKAGE_MANAGER" | ${SUDO} tee "$CONFIG_FILE" > /dev/null echo "package_manager=$PACKAGE_MANAGER" | ${SUDO} tee "$CONFIG_FILE" > /dev/null