mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Add wireguard install option
This commit is contained in:
parent
79d2786638
commit
5028007b7a
@ -235,17 +235,35 @@ function _install_adblock() {
|
|||||||
_install_status 0
|
_install_status 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prompt to install openvpn
|
# Prompt to install VPN
|
||||||
function _prompt_install_openvpn() {
|
function _prompt_install_vpn() {
|
||||||
_install_log "Configure OpenVPN support"
|
_install_log "Configure VPN support"
|
||||||
echo -n "Install OpenVPN and enable client configuration? [Y/n]: "
|
echo -n "Install VPN and enable client configuration? [Y/n]: "
|
||||||
if [ "$assume_yes" == 0 ]; then
|
if [ "$assume_yes" == 0 ]; then
|
||||||
read answer < /dev/tty
|
read answer < /dev/tty
|
||||||
if [ "$answer" != "${answer#[Nn]}" ]; then
|
if [ "$answer" != "${answer#[Nn]}" ]; then
|
||||||
echo -e
|
echo -e
|
||||||
else
|
else
|
||||||
_install_openvpn
|
_install_vpn
|
||||||
fi
|
fi
|
||||||
|
elif [ "$ovpn_option" == 1 ]; then
|
||||||
|
_install_vpn
|
||||||
|
else
|
||||||
|
echo "(Skipped)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _install_vpn() {
|
||||||
|
echo -n "Install [O]penVPN or [W]ireguard? [O/W]: "
|
||||||
|
if [ "$assume_yes" == 0 ]; then
|
||||||
|
read answer < /dev/tty
|
||||||
|
case $answer in
|
||||||
|
[oO]* )
|
||||||
|
_install_openvpn;
|
||||||
|
break;;
|
||||||
|
[wW]* )
|
||||||
|
_install_wireguard;
|
||||||
|
esac
|
||||||
elif [ "$ovpn_option" == 1 ]; then
|
elif [ "$ovpn_option" == 1 ]; then
|
||||||
_install_openvpn
|
_install_openvpn
|
||||||
else
|
else
|
||||||
@ -253,6 +271,20 @@ function _prompt_install_openvpn() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install Wireguard from the Debian unstable distro
|
||||||
|
function _install_wireguard() {
|
||||||
|
_install_log "Configure Wireguard support"
|
||||||
|
echo "Installing Wireguard from Debian unstable distro"
|
||||||
|
echo "Adding Debian distro"
|
||||||
|
echo "deb http://deb.debian.org/debian/ unstable main" | sudo tee --append /etc/apt/sources.list.d/unstable.list || _install_status 1 "Unable to append to sources.list"
|
||||||
|
sudo apt-get install dirmngr || _install_status 1 "Unable to install dirmngr"
|
||||||
|
echo "Adding Debian distro keys"
|
||||||
|
sudo wget -q -O - https://ftp-master.debian.org/keys/archive-key-$(lsb_release -sr).asc | sudo apt-key add - || _install_status 1 "Unable to add keys"
|
||||||
|
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' | sudo tee --append /etc/apt/preferences.d/limit-unstable || _install_status 1 "Unable to append to preferences.d"
|
||||||
|
sudo apt-get update && sudo apt-get install $apt_option wireguard || _install_status 1 "Unable to install wireguard"
|
||||||
|
_install_status 0
|
||||||
|
}
|
||||||
|
|
||||||
# Install openvpn and enable client configuration option
|
# Install openvpn and enable client configuration option
|
||||||
function _install_openvpn() {
|
function _install_openvpn() {
|
||||||
_install_log "Installing OpenVPN and enabling client configuration"
|
_install_log "Installing OpenVPN and enabling client configuration"
|
||||||
@ -537,7 +569,7 @@ function _install_raspap() {
|
|||||||
_default_configuration
|
_default_configuration
|
||||||
_configure_networking
|
_configure_networking
|
||||||
_prompt_install_adblock
|
_prompt_install_adblock
|
||||||
_prompt_install_openvpn
|
_prompt_install_vpn
|
||||||
_patch_system_files
|
_patch_system_files
|
||||||
_install_complete
|
_install_complete
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user