mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
fix(installer): fix code style
Fix a code style bug
This commit is contained in:
parent
97eda159fd
commit
9a7b7dfe72
1 changed files with 24 additions and 39 deletions
|
@ -656,45 +656,30 @@ preconfigurePackages() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if
|
# case 1: If the module is builtin and the package available,
|
||||||
# If the module is builtin and the package available, we only need
|
# we only need to install wireguard-tools.
|
||||||
# to install wireguard-tools.
|
# case 2: If the package is not available, on Debian and
|
||||||
[[ "${WIREGUARD_BUILTIN}" -eq 1 && -n "${AVAILABLE_WIREGUARD}" ]] \
|
# Raspbian we can add it via Bullseye repository.
|
||||||
||
|
# case 3: If the module is not builtin, on Raspbian we know
|
||||||
|
# the headers package: raspberrypi-kernel-headers
|
||||||
|
# case 4: On Alpine, the kernel must be linux-lts or linux-virt
|
||||||
|
# if we want to load the kernel module
|
||||||
|
# case 5: On Alpine Docker Container, the responsibility to have
|
||||||
|
# a WireGuard module on the host system is at user side
|
||||||
|
# case 6: On Debian (and Ubuntu), we can only reliably assume the
|
||||||
|
# headers package for amd64: linux-image-amd64
|
||||||
|
# case 7: On Ubuntu, additionally the WireGuard package needs to
|
||||||
|
# be available, since we didn't test mixing Ubuntu repositories.
|
||||||
|
# case 8: Ubuntu focal has wireguard support
|
||||||
|
|
||||||
# If the package is not available, on Debian and Raspbian we can
|
if [[ "${WIREGUARD_BUILTIN}" -eq 1 && -n "${AVAILABLE_WIREGUARD}" ]] \
|
||||||
# add it via Bullseye repository.
|
|| [[ "${WIREGUARD_BUILTIN}" -eq 1 && ("${PLAT}" == 'Debian' || "${PLAT}" == 'Raspbian') ]] \
|
||||||
[[ "${WIREGUARD_BUILTIN}" -eq 1 && ("${PLAT}" == 'Debian' || "${PLAT}" == 'Raspbian') ]] \
|
|| [[ "${PLAT}" == 'Raspbian' ]] \
|
||||||
||
|
|| [[ "${PLAT}" == 'Alpine' && ! -f /.dockerenv && "$(uname -mrs)" =~ ^Linux\ +[0-9\.\-]+\-((lts)|(virt))\ +.*$ ]] \
|
||||||
|
|| [[ "${PLAT}" == 'Alpine' && -f /.dockerenv ]] \
|
||||||
# If the module is not builtin, on Raspbian we know the headers
|
|| [[ "${PLAT}" == 'Debian' && "${DPKG_ARCH}" == 'amd64' ]] \
|
||||||
# package: raspberrypi-kernel-headers
|
|| [[ "${PLAT}" == 'Ubuntu' && "${DPKG_ARCH}" == 'amd64' && -n "${AVAILABLE_WIREGUARD}" ]] \
|
||||||
[[ "${PLAT}" == 'Raspbian' ]] \
|
|| [[ "${PLAT}" == 'Ubuntu' && "${DPKG_ARCH}" == 'arm64' && "${OSCN}" == 'focal' && -n "${AVAILABLE_WIREGUARD}" ]]; then
|
||||||
||
|
|
||||||
|
|
||||||
# On Alpine, the kernel must be linux-lts or linux-virt if we want to
|
|
||||||
# load the kernel module
|
|
||||||
[[ "${PLAT}" == 'Alpine' && ! -f /.dockerenv && "$(uname -mrs)" =~ ^Linux\ +[0-9\.\-]+\-((lts)|(virt))\ +.*$ ]] \
|
|
||||||
||
|
|
||||||
|
|
||||||
# On Alpine Docker Container, the responsibility to have a WireGuard
|
|
||||||
# module on the host system is at user side
|
|
||||||
[[ "${PLAT}" == 'Alpine' && -f /.dockerenv ]] \
|
|
||||||
||
|
|
||||||
|
|
||||||
# On Debian (and Ubuntu), we can only reliably assume the headers package
|
|
||||||
# for amd64: linux-image-amd64
|
|
||||||
[[ "${PLAT}" == 'Debian' && "${DPKG_ARCH}" == 'amd64' ]] \
|
|
||||||
||
|
|
||||||
|
|
||||||
# On Ubuntu, additionally the WireGuard package needs to be available,
|
|
||||||
# since we didn't test mixing Ubuntu repositories.
|
|
||||||
[[ "${PLAT}" == 'Ubuntu' && "${DPKG_ARCH}" == 'amd64' && -n "${AVAILABLE_WIREGUARD}" ]] \
|
|
||||||
||
|
|
||||||
|
|
||||||
# Ubuntu focal has wireguard support
|
|
||||||
[[ "${PLAT}" == 'Ubuntu' && "${DPKG_ARCH}" == 'arm64' && "${OSCN}" == 'focal' && -n "${AVAILABLE_WIREGUARD}" ]]
|
|
||||||
then
|
|
||||||
WIREGUARD_SUPPORT=1
|
WIREGUARD_SUPPORT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue