Start focal testing for support

Add HWE and PPA Certbot check to install, avoid if not.

(cherry picked from commit d29dea7fef)
This commit is contained in:
Luis Guzmán 2020-07-20 00:47:34 -05:00
parent 84c1568c20
commit 8280661c9a
1 changed files with 43 additions and 26 deletions

View File

@ -22,11 +22,13 @@ fi
# SYSTEM SETUP # SYSTEM SETUP
JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1) JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1)
CERTBOT_REPO=$(apt-cache policy | grep http | grep certbot | head -n 1 | awk '{print $2}' | cut -d "/" -f4) CERTBOT_REPO=$(apt-cache policy | grep http | grep certbot | head -n 1 | awk '{print $2}' | cut -d "/" -f4)
CERTBOT_REL_FILE="http://ppa.launchpad.net/certbcertbot/ubuntu/dists/$(lsb_release -sc)/Release"
APACHE_2=$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") APACHE_2=$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed")
NGINX=$(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") NGINX=$(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed")
DIST=$(lsb_release -sc) DIST=$(lsb_release -sc)
GOOGL_REPO="/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list" GOOGL_REPO="/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list"
PROSODY_REPO=$(apt-cache policy | grep http | grep prosody| awk '{print $3}' | head -n 1 | cut -d "/" -f2) PROSODY_REPO=$(apt-cache policy | grep http | grep prosody| awk '{print $3}' | head -n 1 | cut -d "/" -f2)
HWE_VIR_MOD=$(apt-cache madison linux-modules-extra-virtual-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "extra-virtual-hwe")
if [ $DIST = flidas ]; then if [ $DIST = flidas ]; then
DIST="xenial" DIST="xenial"
@ -79,24 +81,6 @@ else
read -n 1 -s -r -p "Press any key to continue..."$'\n' read -n 1 -s -r -p "Press any key to continue..."$'\n'
fi fi
} }
update_certbot() {
if [ "$CERTBOT_REPO" = "certbot" ]; then
echo "
Cerbot repository already on the system!
Checking for updates...
"
apt-get -q2 update
apt-get -yq2 dist-upgrade
else
echo "
Adding cerbot (formerly letsencrypt) PPA repository for latest updates
"
echo "deb http://ppa.launchpad.net/certbot/certbot/ubuntu $DIST main" > /etc/apt/sources.list.d/certbot.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 75BCA694
apt-get -q2 update
apt-get -yq2 dist-upgrade
fi
}
# sed limiters for add-jibri-node.sh variables # sed limiters for add-jibri-node.sh variables
var_dlim() { var_dlim() {
grep -n $1 add-jibri-node.sh|head -n1|cut -d ":" -f1 grep -n $1 add-jibri-node.sh|head -n1|cut -d ":" -f1
@ -135,12 +119,14 @@ if ! [ $(id -u) = 0 ]; then
echo "You need to be root or have sudo privileges!" echo "You need to be root or have sudo privileges!"
exit 0 exit 0
fi fi
if [ "$DIST" = "xenial" ] || [ "$DIST" = "bionic" ]; then if [ "$DIST" = "xenial" ] || \
echo "OS: $(lsb_release -sd) [ "$DIST" = "bionic" ] || \
Good, this is a supported platform!" [ "$DIST" = "focal" ]; then
echo "OS: $(lsb_release -sd)"
echo "Good, this is a supported platform!"
else else
echo "OS: $(lsb_release -sd) echo "OS: $(lsb_release -sd)"
Sorry, this platform is not supported... exiting" echo "Sorry, this platform is not supported... exiting"
exit exit
fi fi
#Suggest 18.04 LTS release over 16.04 #Suggest 18.04 LTS release over 16.04
@ -223,11 +209,19 @@ apt-get -y install \
git \ git \
htop \ htop \
letsencrypt \ letsencrypt \
linux-image-generic-hwe-$(lsb_release -r|awk '{print$2}') \
linux-modules-extra-virtual-hwe-$(lsb_release -r|awk '{print$2}') \
unzip \ unzip \
wget wget
echo "# Check and Install HWE kernel if possible..."
if [ "$HWE_VIR_MOD" == "1" ]; then
apt-get -y install \
linux-image-generic-hwe-$(lsb_release -sr) \
linux-modules-extra-virtual-hwe-$(lsb_release -sr)
else
apt-get -y install \
linux-modules-extra-$(uname -r)
fi
check_serv check_serv
echo " echo "
@ -505,7 +499,30 @@ echo '
#Disabled 'til fixed upstream #Disabled 'til fixed upstream
#bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh #bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
update_certbot echo "#Set and upgrade certbot PPA if posssible..."
if [ "$CERTBOT_REPO" = "certbot" ]; then
echo "
Cerbot repository already on the system!
Checking for updates...
"
apt-get -q2 update
apt-get -yq2 dist-upgrade
else
if [ "$(curl -s -o /dev/null -w "%{http_code}" $CERTBOT_REL_FILE )" == "200" ]; then
echo "
Adding cerbot (formerly letsencrypt) PPA repository for latest updates
"
echo "deb http://ppa.launchpad.net/certbot/certbot/ubuntu $DIST main" > /etc/apt/sources.list.d/certbot.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 75BCA694
apt-get -q2 update
apt-get -yq2 dist-upgrade
fi
if [ "$(curl -s -o /dev/null -w "%{http_code}" $CERTBOT_REL_FILE )" == "404" ]; then
echo "
Certbot PPA is not available for $(lsb_release -sc) just yet, it won't be installed...
"
fi
fi
else else
echo "SSL setup will be skipped." echo "SSL setup will be skipped."