6.4.5 #79
			
				
			
		
		
		
	| 
						 | 
				
			
			@ -44,7 +44,7 @@ fi
 | 
			
		|||
}
 | 
			
		||||
DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')"
 | 
			
		||||
MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
 | 
			
		||||
PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')"
 | 
			
		||||
ETHERPAD_DB_USER="dockerpad"
 | 
			
		||||
ETHERPAD_DB_NAME="etherpad"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ MAIN_TEL="/etc/telegraf/telegraf.conf"
 | 
			
		|||
TEL_JIT="/etc/telegraf/telegraf.d/jitsi.conf"
 | 
			
		||||
GRAFANA_INI="/etc/grafana/grafana.ini"
 | 
			
		||||
DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
 | 
			
		||||
GRAFANA_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)"
 | 
			
		||||
 | 
			
		||||
# Min requirements
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,7 +45,7 @@ PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')"
 | 
			
		|||
PHP_FPM_DIR="/etc/php/$PHPVER/fpm"
 | 
			
		||||
PHP_INI="$PHP_FPM_DIR/php.ini"
 | 
			
		||||
PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf"
 | 
			
		||||
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-enabled/$DOMAIN.conf | awk '{print$2}')"
 | 
			
		||||
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/$DOMAIN.conf | awk '{print$2}')"
 | 
			
		||||
NC_REPO="https://download.nextcloud.com/server/releases"
 | 
			
		||||
NCVERSION="$(curl -s -m 900 $NC_REPO/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | sort --version-sort | tail -1)"
 | 
			
		||||
STABLEVERSION="nextcloud-$NCVERSION"
 | 
			
		||||
| 
						 | 
				
			
			@ -419,7 +419,7 @@ NC_NGINX
 | 
			
		|||
systemctl stop nginx
 | 
			
		||||
letsencrypt certonly --standalone --renew-by-default --agree-tos -d $NC_DOMAIN
 | 
			
		||||
if [ -f /etc/letsencrypt/live/$NC_DOMAIN/fullchain.pem ];then
 | 
			
		||||
    ln -s $NC_NGINX_CONF /etc/nginx/sites-enabled/
 | 
			
		||||
    ln -s $NC_NGINX_CONF /etc/nginx/sites-available/
 | 
			
		||||
else
 | 
			
		||||
    echo "There are issues on getting the SSL certs..."
 | 
			
		||||
    read -n 1 -s -r -p "Press any key to continue"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js"
 | 
			
		|||
MEET_CONF_HP="/etc/jitsi/meet/${DOMAIN}-chp-config.js"
 | 
			
		||||
INT_CONF_JS="/etc/jitsi/meet/${DOMAIN}-interface_config.js"
 | 
			
		||||
INT_CONF_JS_HP="/etc/jitsi/meet/${DOMAIN}-chp-interface_config.js"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
 | 
			
		||||
FSTAB="/etc/fstab"
 | 
			
		||||
CHAT_DISABLED="TBD"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -341,7 +341,8 @@ if [ "$LE_SSL" = "yes" ]; then
 | 
			
		|||
apt-get -y install \
 | 
			
		||||
                letsencrypt
 | 
			
		||||
    if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1"  ]; then
 | 
			
		||||
        echo "# Disable pre-installed ufw to allow ssl challenges validation."
 | 
			
		||||
        echo "# Disable pre-installed ufw, more on firewall see:
 | 
			
		||||
    > https://github.com/switnet-ltd/quick-jibri-installer/wiki/Firewall"
 | 
			
		||||
        ufw disable
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			@ -451,8 +452,8 @@ echo '
 | 
			
		|||
########################################################################
 | 
			
		||||
'
 | 
			
		||||
# MEET / JIBRI SETUP
 | 
			
		||||
DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf"
 | 
			
		||||
DOMAIN="$(find /etc/prosody/conf.d/ -name *.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
 | 
			
		||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
 | 
			
		||||
JB_AUTH_PASS="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1)"
 | 
			
		||||
JB_REC_PASS="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1)"
 | 
			
		||||
PROSODY_FILE="/etc/prosody/conf.d/$DOMAIN.cfg.lua"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,70 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
# Automated AWS generic kernel setup for jibri.
 | 
			
		||||
# SwITNet Ltd © - 2022, https://switnet.net/
 | 
			
		||||
# GPLv3 or later.
 | 
			
		||||
 | 
			
		||||
####
 | 
			
		||||
# NOTE: Only use this script if you know what you are doing.
 | 
			
		||||
# Under your own risk.
 | 
			
		||||
# This program is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY.
 | 
			
		||||
####
 | 
			
		||||
wait_seconds() {
 | 
			
		||||
secs=$(($1))
 | 
			
		||||
while [ $secs -gt 0 ]; do
 | 
			
		||||
   echo -ne "$secs\033[0K\r"
 | 
			
		||||
   sleep 1
 | 
			
		||||
   : $((secs--))
 | 
			
		||||
done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Check if user is root
 | 
			
		||||
if [ $UID != 0 ]; then
 | 
			
		||||
    echo You need to run this script as root or sudo rights!
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
TMP_DIR="$(mktemp -d)"
 | 
			
		||||
KERNEL_LOG="$TMP_DIR/kernel_log"
 | 
			
		||||
GRUB_FILE="/etc/default/grub"
 | 
			
		||||
 | 
			
		||||
echo -e "# Check and update HWE kernel if possible...\n"
 | 
			
		||||
apt-get -q2 update
 | 
			
		||||
HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)")
 | 
			
		||||
if [ "$HWE_VIR_MOD" = "1" ]; then
 | 
			
		||||
    apt-get -y install \
 | 
			
		||||
    linux-image-generic-hwe-$(lsb_release -sr) \
 | 
			
		||||
    linux-tools-generic-hwe-$(lsb_release -sr)
 | 
			
		||||
else
 | 
			
		||||
    apt-get -y install \
 | 
			
		||||
    linux-image-generic \
 | 
			
		||||
    linux-modules-extra-$(uname -r)
 | 
			
		||||
fi
 | 
			
		||||
apt-get -y autoremove
 | 
			
		||||
apt-get autoclean
 | 
			
		||||
 | 
			
		||||
#Write update-grub output
 | 
			
		||||
update-grub > $KERNEL_LOG 2>&1
 | 
			
		||||
 | 
			
		||||
#Get clean output
 | 
			
		||||
cat $KERNEL_LOG | awk -F'boot/' '{print$2}'|sed '/^[[:space:]]*$/d' | \
 | 
			
		||||
tee ${KERNEL_LOG}.tmp
 | 
			
		||||
mv ${KERNEL_LOG}.tmp $KERNEL_LOG
 | 
			
		||||
 | 
			
		||||
echo -e "Check if AWS kernel is installed.\n"
 | 
			
		||||
[ $(grep -wc aws $KERNEL_LOG) = 0 ] && echo "No AWS kernel found, exiting..." && exit
 | 
			
		||||
 | 
			
		||||
#Get kernel number
 | 
			
		||||
RAW_KERNEL_NUM="$(grep -Fn generic $KERNEL_LOG|head -n1|cut -d ':' -f1)"
 | 
			
		||||
FIXED_KERNEL_NUM="$(awk "BEGIN{ print $RAW_KERNEL_NUM - 1 }")"
 | 
			
		||||
 | 
			
		||||
echo -e "Set up GRUB for custom kernel.\n"
 | 
			
		||||
sed -i "s|GRUB_DEFAULT=.*|GRUB_DEFAULT=\"1\>$FIXED_KERNEL_NUM\"|" $GRUB_FILE
 | 
			
		||||
 | 
			
		||||
echo -e "Saving changes...\n"
 | 
			
		||||
update-grub
 | 
			
		||||
 | 
			
		||||
echo "Time to reboot..."
 | 
			
		||||
echo "Rebooting in..."
 | 
			
		||||
wait_seconds 15
 | 
			
		||||
reboot
 | 
			
		||||
| 
						 | 
				
			
			@ -79,8 +79,8 @@ if [ "$CONTINUE_PURGE2" = "no" ]; then
 | 
			
		|||
    echo "  Good, see you next time..."
 | 
			
		||||
    exit
 | 
			
		||||
elif [ "$CONTINUE_PURGE2" = "yes" ]; then
 | 
			
		||||
    echo "No going back, lets start..."
 | 
			
		||||
    wait_seconds 5
 | 
			
		||||
    echo "No going back, let's start..."
 | 
			
		||||
    wait_seconds 10
 | 
			
		||||
fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue