Distro Support, Bug Fixes, Unattended install

Tested and added Support on Debian 9
tested and added support on Ubuntu 16.04 & 18.08
  * Fixed wireguard not installing, added pkg cache update after adding ppa
  * added kernel headers to dependencies as its requred for wireguard-dkms
unattended install
  * When user is provided and doest exist, it will create one without password set
This commit is contained in:
4s3ti 2020-01-18 20:01:39 +01:00
parent e08903fa8a
commit 1884be8afb

View file

@ -246,14 +246,14 @@ distroCheck(){
source /etc/os-release source /etc/os-release
PLAT=$(awk '{print $1}' <<< "$NAME") PLAT=$(awk '{print $1}' <<< "$NAME")
VER="$VERSION_ID" VER="$VERSION_ID"
declare -A VER_MAP=(["10"]="buster" ["18.04"]="bionic") declare -A VER_MAP=(["9"]="stretch" ["10"]="buster" ["16.04"]="xenial" ["18.04"]="bionic")
OSCN=${VER_MAP["${VER}"]} OSCN=${VER_MAP["${VER}"]}
fi fi
case ${PLAT} in case ${PLAT} in
Debian|Raspbian|Ubuntu) Debian|Raspbian|Ubuntu)
case ${OSCN} in case ${OSCN} in
buster|bionic) buster|xenial|bionic|stretch)
: :
;; ;;
*) *)
@ -752,8 +752,9 @@ chooseUser(){
if awk -F':' '$3>=1000 && $3<=60000 {print $1}' /etc/passwd | grep -qw "${install_user}"; then if awk -F':' '$3>=1000 && $3<=60000 {print $1}' /etc/passwd | grep -qw "${install_user}"; then
echo "::: ${install_user} will hold your ovpn configurations." echo "::: ${install_user} will hold your ovpn configurations."
else else
echo "::: User ${install_user} does not exist" echo "::: User ${install_user} does not exist, creating..."
exit 1 $SUDO useradd -m -s /bin/bash "${install_user}"
echo "::: User created without a password, please do sudo passwd $install_user to create one"
fi fi
fi fi
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6) install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
@ -1098,7 +1099,8 @@ installWireGuard(){
echo "::: Installing WireGuard from PPA... " echo "::: Installing WireGuard from PPA... "
$SUDO add-apt-repository ppa:wireguard/wireguard -y $SUDO add-apt-repository ppa:wireguard/wireguard -y
PIVPN_DEPS=(qrencode wireguard wireguard-tools wireguard-dkms) $SUDO ${UPDATE_PKG_CACHE}
PIVPN_DEPS=(qrencode wireguard wireguard-tools wireguard-dkms linux-headers-$(uname -r))
installDependentPackages PIVPN_DEPS[@] installDependentPackages PIVPN_DEPS[@]
fi fi