prepare_php.sh: add missing install_ifnot function #106
|
@ -43,7 +43,6 @@ apt-get update -q2
|
||||||
apt-get install -y curl letsencrypt nginx
|
apt-get install -y curl letsencrypt nginx
|
||||||
|
|
||||||
MIN_PHP="8.2"
|
MIN_PHP="8.2"
|
||||||
DISTRO_RELEASE="$(lsb_release -sc)"
|
|
||||||
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
||||||
PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')"
|
PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')"
|
||||||
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/"$DOMAIN".conf | awk '{print$2}')"
|
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/"$DOMAIN".conf | awk '{print$2}')"
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
|
|
||||||
PHPVER=$1
|
PHPVER=$1
|
||||||
STABLE_PHP="$(apt-cache madison php|grep -v ppa|awk -F'[:+]' 'NR==1{print $2}')"
|
STABLE_PHP="$(apt-cache madison php|grep -v ppa|awk -F'[:+]' 'NR==1{print $2}')"
|
||||||
|
DISTRO_RELEASE="$(lsb_release -sc)"
|
||||||
PHP_REPO="$(apt-cache policy | awk '/http/&&/php/{print$2}' | awk -F "/" 'NR==1{print$5}')"
|
PHP_REPO="$(apt-cache policy | awk '/http/&&/php/{print$2}' | awk -F "/" 'NR==1{print$5}')"
|
||||||
|
PHP_REPO_URL="http://ppa.launchpad.net/ondrej/php/ubuntu"
|
||||||
PHP_FPM_DIR="/etc/php/$PHPVER/fpm"
|
PHP_FPM_DIR="/etc/php/$PHPVER/fpm"
|
||||||
PHP_INI="$PHP_FPM_DIR/php.ini"
|
PHP_INI="$PHP_FPM_DIR/php.ini"
|
||||||
PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf"
|
PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf"
|
||||||
|
@ -46,7 +48,8 @@ if [ "$PHP_REPO" = "php" ]; then
|
||||||
else
|
else
|
||||||
echo "# Adding Ondrej PHP $PHPVER PPA Repository"
|
echo "# Adding Ondrej PHP $PHPVER PPA Repository"
|
||||||
add_gpg_keyring E5267A6C
|
add_gpg_keyring E5267A6C
|
||||||
echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php"$PHPVER".list
|
echo "deb [arch=amd64] $PHP_REPO_URL $DISTRO_RELEASE main" | \
|
||||||
|
tee /etc/apt/sources.list.d/php"$PHPVER".list
|
||||||
apt-get update -q2
|
apt-get update -q2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue