https://github.com/angristan/wireguard-install/blob/master/wireguard-install.sh
#!/bin/bash # Secure WireGuard server installer # https://github.com/angristan/wireguard-install RED='\033[0;31m' ORANGE='\033[0;33m' GREEN='\033[0;32m' NC='\033[0m' function isRoot() { if [ "${EUID}" -ne 0 ]; then echo "You need to run this script as root" exit 1 fi } function checkVirt() { if [ "$(systemd-detect-virt)" == "openvz" ]; then echo "OpenVZ is not supported" exit 1 fi if [ "$(systemd-detect-virt)" == "lxc" ]; then echo "LXC is not supported (yet)." echo "WireGuard can technically run in an LXC container," echo "but the kernel module has to be installed on the host," echo "the container has to be run with some specific parameters" echo "and only the tools need to be installed in the container.
https://github.com/angristan/openvpn-install/blob/master/openvpn-install.sh
#!/bin/bash # shellcheck disable=SC1091,SC2164,SC2034,SC1072,SC1073,SC1009 # Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora, Oracle Linux 8, Arch Linux, Rocky Linux and AlmaLinux. # https://github.com/angristan/openvpn-install function isRoot() { if [ "$EUID" -ne 0 ]; then return 1 fi } function tunAvailable() { if [ ! -e /dev/net/tun ]; then return 1 fi } function checkOS() { if [[ -e /etc/debian_version ]]; then OS="debian" source /etc/os-release if [[ $ID == "debian" || $ID == "raspbian" ]]; then if [[ $VERSION_ID -lt 9 ]]; then echo "⚠️ Your version of Debian is not supported.