Fix issues with APT repositories
This commit is contained in:
47
install
47
install
@@ -9,7 +9,7 @@
|
||||
# -------------------------------------------------------------------------
|
||||
# wget -qO wo wops.cc && sudo bash wo
|
||||
# -------------------------------------------------------------------------
|
||||
# Version 3.9.9.3 - 2019-10-05
|
||||
# Version 3.9.9.3 - 2019-10-08
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# CONTENTS
|
||||
@@ -90,14 +90,15 @@ if [[ $EUID -ne 0 ]]; then
|
||||
exit 100
|
||||
fi
|
||||
|
||||
###
|
||||
# 1- Update the apt sewers with fresh info
|
||||
###
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
unset LANG
|
||||
export LANG='en_US.UTF-8'
|
||||
export LC_ALL='C.UTF-8'
|
||||
|
||||
###
|
||||
# 1- Main functions
|
||||
###
|
||||
|
||||
# check if a command exist
|
||||
command_exists() {
|
||||
command -v "$@" > /dev/null 2>&1
|
||||
@@ -114,14 +115,9 @@ _run() {
|
||||
|
||||
}
|
||||
|
||||
check_path() {
|
||||
if [ -d "$1" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
###
|
||||
# 1- Update the apt sewers with fresh info
|
||||
###
|
||||
if [ -z "$wo_travis" ]; then
|
||||
if command_exists curl; then
|
||||
apt-get update -qq
|
||||
@@ -219,18 +215,32 @@ wo_dist_upgrade() {
|
||||
apt-get dist-upgrade --option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet
|
||||
}
|
||||
|
||||
# install apt-mirror-updater and find the fastest mirror available
|
||||
wo_apt_mirror() {
|
||||
|
||||
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
||||
python3-pip python3-wheel python3-apt python3-setuptools > /dev/null 2>&1
|
||||
python3 -m pip install pip --upgrade
|
||||
if {
|
||||
python3 -m pip install apt-mirror-updater --upgrade
|
||||
}; then
|
||||
/usr/local/bin/apt-mirror-updater -a
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
wo_install_dep() {
|
||||
|
||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
||||
# install dependencies
|
||||
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
||||
build-essential curl gzip python3-pip python3-wheel python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz \
|
||||
gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
||||
build-essential curl gzip python3-dev sqlite3 git tar software-properties-common pigz \
|
||||
gnupg2 cron ccze rsync apt-transport-https tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
||||
add-apt-repository ppa:wordops/nginx-wo -yn
|
||||
else
|
||||
# install dependencies
|
||||
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
||||
build-essential curl gzip dirmngr sudo python3 python3-pip python3-wheel python3-apt python3-setuptools python3-dev ca-certificates sqlite3 git tar \
|
||||
build-essential curl gzip dirmngr sudo python3-dev ca-certificates sqlite3 git tar \
|
||||
software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
||||
# add php repository gpg key
|
||||
[ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; }
|
||||
@@ -455,7 +465,6 @@ wo_git_config() {
|
||||
# WordOps install
|
||||
wo_install() {
|
||||
|
||||
python3 -m pip install pip --upgrade
|
||||
python3 -m pip install wordops --upgrade
|
||||
cp -rf /usr/local/lib/python3.*/dist-packages/etc/* /etc/
|
||||
cp -rf /usr/local/lib/python3.*/dist-packages/usr/* /usr/
|
||||
@@ -465,7 +474,6 @@ wo_install() {
|
||||
# WordOps install
|
||||
wo_travis_install() {
|
||||
|
||||
python3 -m pip install pip --upgrade
|
||||
python3 -m pip install dist/*.whl --upgrade
|
||||
cp -rf /usr/local/lib/python3.*/dist-packages/etc/* /etc/
|
||||
cp -rf /usr/local/lib/python3.*/dist-packages/usr/* /usr/
|
||||
@@ -588,7 +596,9 @@ wo_backup_ee() {
|
||||
}
|
||||
|
||||
wo_backup_wo() {
|
||||
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /etc/wo /var/lib/wo
|
||||
if [ -d /etc/nginx ] && [ -d /etc/wo ] && [ -d /var/lib/wo ]; then
|
||||
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /etc/wo /var/lib/wo
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -774,6 +784,7 @@ else
|
||||
_run wo_remove_ee_cron "Removing EasyEngine cronjob"
|
||||
_run wo_sync_db "Syncing WO database"
|
||||
fi
|
||||
_run wo_apt_mirror "Finding the fastest APT mirror"
|
||||
_run wo_install_dep "Installing wo dependencies"
|
||||
_run wo_timesync
|
||||
#if [ "$ufw" = "y" ]; then
|
||||
|
||||
Reference in New Issue
Block a user