Fix missing purge
This commit is contained in:
57
install
57
install
@@ -103,7 +103,11 @@ export DEBIAN_FRONTEND=noninteractive
|
|||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$(command -v curl)" ]; then
|
command_exists() {
|
||||||
|
command -v "$@" > /dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! command_exists curl; then
|
||||||
apt-get -y install curl -qq
|
apt-get -y install curl -qq
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -120,9 +124,9 @@ echo ""
|
|||||||
###
|
###
|
||||||
# 1- Check whether lsb_release is installed, and if not, install it
|
# 1- Check whether lsb_release is installed, and if not, install it
|
||||||
###
|
###
|
||||||
if [ -z "$(command -v lsb_release)" ]; then
|
if ! command_exists lsb_release; then
|
||||||
wo_lib_echo "Installing lsb-release, please wait..."
|
wo_lib_echo "Installing lsb-release, please wait..."
|
||||||
apt-get -y install lsb-release -qq
|
apt-get install lsb-release -qq
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -191,11 +195,9 @@ fi
|
|||||||
####
|
####
|
||||||
|
|
||||||
wo_dist_upgrade() {
|
wo_dist_upgrade() {
|
||||||
[ -z "$wo_travis" ] && {
|
# update server packages
|
||||||
# update server packages
|
apt-get dist-upgrade --option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet
|
||||||
apt-get dist-upgrade --option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet
|
} >> "$wo_install_log" 2>&1
|
||||||
} >> "$wo_install_log" 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
wo_install_dep() {
|
wo_install_dep() {
|
||||||
|
|
||||||
@@ -223,17 +225,19 @@ wo_install_dep() {
|
|||||||
if [ ! -f /etc/apt/apt.conf.d/20auto-upgrades ]; then
|
if [ ! -f /etc/apt/apt.conf.d/20auto-upgrades ]; then
|
||||||
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades
|
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
fi
|
fi
|
||||||
# set default ntp pools
|
|
||||||
if ! grep -q "time.cloudflare.com" /etc/systemd/timesyncd.conf; then
|
|
||||||
sed -e 's/^#NTP=/NTP=time.cloudflare.com 0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org/' -i /etc/systemd/timesyncd.conf
|
|
||||||
# enable ntp
|
|
||||||
timedatectl set-ntp 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
} >> "$wo_install_log" 2>&1
|
} >> "$wo_install_log" 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wo_timesync() {
|
||||||
|
# set default ntp pools
|
||||||
|
if ! grep -q "time.cloudflare.com" /etc/systemd/timesyncd.conf; then
|
||||||
|
sed -e 's/^#NTP=/NTP=time.cloudflare.com 0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org/' -i /etc/systemd/timesyncd.conf
|
||||||
|
# enable ntp
|
||||||
|
timedatectl set-ntp 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
# 3 - Create/migrate the essentials
|
# 3 - Create/migrate the essentials
|
||||||
###
|
###
|
||||||
@@ -695,14 +699,14 @@ wo_mariadb_tweak() {
|
|||||||
wo_nginx_tweak() {
|
wo_nginx_tweak() {
|
||||||
# increase nginx open_files_limit
|
# increase nginx open_files_limit
|
||||||
{
|
{
|
||||||
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
|
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
|
||||||
mkdir -p /etc/systemd/system/nginx.service.d
|
mkdir -p /etc/systemd/system/nginx.service.d
|
||||||
if [ ! -f /etc/systemd/system/nginx.service.d/limits.conf ]; then
|
if [ ! -f /etc/systemd/system/nginx.service.d/limits.conf ]; then
|
||||||
echo -e '[Service]\nLimitNOFILE=500000' > /etc/systemd/system/nginx.service.d/limits.conf
|
echo -e '[Service]\nLimitNOFILE=500000' > /etc/systemd/system/nginx.service.d/limits.conf
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
nginx -t && service nginx restart
|
nginx -t && service nginx restart
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
} >> /var/log/wo/install.log 2>&1
|
} >> /var/log/wo/install.log 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,7 +720,7 @@ wo_uninstall() {
|
|||||||
|
|
||||||
wo_cheat_alias() {
|
wo_cheat_alias() {
|
||||||
if ! grep -q "cheat" "$HOME/.bashrc"; then
|
if ! grep -q "cheat" "$HOME/.bashrc"; then
|
||||||
echo "alias cheat='/usr/local/bin/cht.sh'" >> "$HOME/.bashrc"
|
echo "alias cheat='/usr/local/bin/cht.sh'" >> "$HOME/.bashrc"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -803,6 +807,7 @@ else
|
|||||||
} || [ "$wo_force_install" = "y" ]; then
|
} || [ "$wo_force_install" = "y" ]; then
|
||||||
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_timesync | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log
|
wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log
|
||||||
wo_backup_wo | tee -ai $wo_install_log
|
wo_backup_wo | tee -ai $wo_install_log
|
||||||
secure_wo_db | tee -ai $wo_install_log
|
secure_wo_db | tee -ai $wo_install_log
|
||||||
@@ -852,6 +857,7 @@ else
|
|||||||
if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then
|
if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then
|
||||||
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_timesync | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Backing-up EE install" | tee -ai $wo_install_log
|
wo_lib_echo "Backing-up EE install" | tee -ai $wo_install_log
|
||||||
wo_backup_ee | tee -ai $wo_install_log
|
wo_backup_ee | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Removing EasyEngine cronjob" | tee -ai $wo_install_log
|
wo_lib_echo "Removing EasyEngine cronjob" | tee -ai $wo_install_log
|
||||||
@@ -897,8 +903,11 @@ else
|
|||||||
else
|
else
|
||||||
# 3 - Fresh WO setup
|
# 3 - Fresh WO setup
|
||||||
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
||||||
wo_dist_upgrade | tee -ai $wo_install_log
|
[ -z "$wo_travis" ] && {
|
||||||
|
wo_dist_upgrade | tee -ai $wo_install_log
|
||||||
|
}
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_timesync | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log
|
wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log
|
||||||
if [ "$wo_travis" = "y" ]; then
|
if [ "$wo_travis" = "y" ]; then
|
||||||
wo_install_travis | tee -ai $wo_install_log
|
wo_install_travis | tee -ai $wo_install_log
|
||||||
|
|||||||
@@ -151,9 +151,9 @@ class WOStackController(CementBaseController):
|
|||||||
pargs.wpcli = True
|
pargs.wpcli = True
|
||||||
|
|
||||||
if pargs.admin:
|
if pargs.admin:
|
||||||
pargs.web = True
|
|
||||||
pargs.adminer = True
|
pargs.adminer = True
|
||||||
pargs.phpmyadmin = True
|
pargs.phpmyadmin = True
|
||||||
|
pargs.composer = True
|
||||||
pargs.utils = True
|
pargs.utils = True
|
||||||
pargs.netdata = True
|
pargs.netdata = True
|
||||||
pargs.dashboard = True
|
pargs.dashboard = True
|
||||||
@@ -639,7 +639,7 @@ class WOStackController(CementBaseController):
|
|||||||
if os.path.isdir('{0}22222/htdocs/cache/redis'
|
if os.path.isdir('{0}22222/htdocs/cache/redis'
|
||||||
.format(WOVariables.wo_webroot)):
|
.format(WOVariables.wo_webroot)):
|
||||||
packages = packages + ['{0}22222/htdocs/'
|
packages = packages + ['{0}22222/htdocs/'
|
||||||
'cache/redis/phpRedisAdmin'
|
'cache/redis'
|
||||||
.format(WOVariables.wo_webroot)]
|
.format(WOVariables.wo_webroot)]
|
||||||
# ADMINER
|
# ADMINER
|
||||||
if pargs.adminer:
|
if pargs.adminer:
|
||||||
@@ -677,7 +677,7 @@ class WOStackController(CementBaseController):
|
|||||||
' remove from server.'
|
' remove from server.'
|
||||||
'\nPackage configuration will remain'
|
'\nPackage configuration will remain'
|
||||||
' on server after this operation.\n'
|
' on server after this operation.\n'
|
||||||
'Remove stacks [y/N]')
|
'Remove stacks [y/N]?')
|
||||||
if start_remove != "Y" and start_remove != "y":
|
if start_remove != "Y" and start_remove != "y":
|
||||||
Log.error(self, "Not starting stack removal")
|
Log.error(self, "Not starting stack removal")
|
||||||
Log.info(self, "Removing stacks, please wait...")
|
Log.info(self, "Removing stacks, please wait...")
|
||||||
@@ -687,17 +687,22 @@ class WOStackController(CementBaseController):
|
|||||||
# Netdata uninstaller
|
# Netdata uninstaller
|
||||||
if (set(['/var/lib/wo/tmp/'
|
if (set(['/var/lib/wo/tmp/'
|
||||||
'kickstart.sh']).issubset(set(packages))):
|
'kickstart.sh']).issubset(set(packages))):
|
||||||
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
if WOVariables.wo_distro == 'Raspbian':
|
||||||
"libexec/netdata-"
|
WOShellExec.cmd_exec(self, "bash /usr/"
|
||||||
"uninstaller.sh -y -f")
|
"libexec/netdata-"
|
||||||
|
"uninstaller.sh -y -f")
|
||||||
|
else:
|
||||||
|
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
||||||
|
"libexec/netdata-"
|
||||||
|
"uninstaller.sh -y -f")
|
||||||
|
|
||||||
if (packages):
|
if (packages):
|
||||||
|
Log.info(self, "Removing packages, please wait...")
|
||||||
WOFileUtils.remove(self, packages)
|
WOFileUtils.remove(self, packages)
|
||||||
WOAptGet.auto_remove(self)
|
|
||||||
|
|
||||||
if (apt_packages):
|
if (apt_packages):
|
||||||
Log.debug(self, "Removing apt_packages")
|
Log.debug(self, "Removing apt_packages")
|
||||||
Log.info(self, "Removing packages, please wait...")
|
Log.info(self, "Removing apt packages, please wait...")
|
||||||
WOAptGet.remove(self, apt_packages)
|
WOAptGet.remove(self, apt_packages)
|
||||||
WOAptGet.auto_remove(self)
|
WOAptGet.auto_remove(self)
|
||||||
|
|
||||||
@@ -748,6 +753,7 @@ class WOStackController(CementBaseController):
|
|||||||
pargs.composer = True
|
pargs.composer = True
|
||||||
pargs.netdata = True
|
pargs.netdata = True
|
||||||
pargs.mysqltuner = True
|
pargs.mysqltuner = True
|
||||||
|
pargs.cheat = True
|
||||||
|
|
||||||
if pargs.security:
|
if pargs.security:
|
||||||
pargs.fail2ban = True
|
pargs.fail2ban = True
|
||||||
@@ -779,6 +785,16 @@ class WOStackController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
apt_packages = apt_packages + WOVariables.wo_php73
|
apt_packages = apt_packages + WOVariables.wo_php73
|
||||||
|
|
||||||
|
# REDIS
|
||||||
|
if pargs.redis:
|
||||||
|
Log.debug(self, "Remove apt_packages variable of Redis")
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_redis
|
||||||
|
|
||||||
|
# MariaDB
|
||||||
|
if pargs.mysql:
|
||||||
|
Log.debug(self, "Removing apt_packages variable of MySQL")
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_mysql
|
||||||
|
|
||||||
# mysqlclient
|
# mysqlclient
|
||||||
if pargs.mysqlclient:
|
if pargs.mysqlclient:
|
||||||
Log.debug(self, "Removing apt_packages variable "
|
Log.debug(self, "Removing apt_packages variable "
|
||||||
@@ -832,7 +848,7 @@ class WOStackController(CementBaseController):
|
|||||||
if os.path.isdir('{0}22222/htdocs/cache/redis'
|
if os.path.isdir('{0}22222/htdocs/cache/redis'
|
||||||
.format(WOVariables.wo_webroot)):
|
.format(WOVariables.wo_webroot)):
|
||||||
packages = packages + ['{0}22222/htdocs/'
|
packages = packages + ['{0}22222/htdocs/'
|
||||||
'cache/redis/phpRedisAdmin'
|
'cache/redis'
|
||||||
.format(WOVariables.wo_webroot)]
|
.format(WOVariables.wo_webroot)]
|
||||||
# Adminer
|
# Adminer
|
||||||
if pargs.adminer:
|
if pargs.adminer:
|
||||||
@@ -842,16 +858,16 @@ class WOStackController(CementBaseController):
|
|||||||
# utils
|
# utils
|
||||||
if pargs.utils:
|
if pargs.utils:
|
||||||
Log.debug(self, "Purge package variable utils")
|
Log.debug(self, "Purge package variable utils")
|
||||||
packages = packages + ['{0}22222/htdocs/php/webgrind/'
|
packages = packages + [['{0}22222/htdocs/php/webgrind/'
|
||||||
.format(WOVariables.wo_webroot),
|
.format(WOVariables.wo_webroot),
|
||||||
'{0}22222/htdocs/cache/opcache'
|
'{0}22222/htdocs/cache/opcache'
|
||||||
.format(WOVariables.wo_webroot),
|
.format(WOVariables.wo_webroot),
|
||||||
'{0}22222/htdocs/cache/nginx/'
|
'{0}22222/htdocs/cache/nginx/'
|
||||||
'clean.php'.format(WOVariables.wo_webroot),
|
'clean.php'.format(WOVariables.wo_webroot),
|
||||||
'/usr/bin/pt-query-advisor',
|
'/usr/bin/pt-query-advisor',
|
||||||
'{0}22222/htdocs/db/anemometer'
|
'{0}22222/htdocs/db/anemometer'
|
||||||
.format(WOVariables.wo_webroot)
|
.format(WOVariables.wo_webroot)
|
||||||
]
|
]]
|
||||||
|
|
||||||
if pargs.netdata:
|
if pargs.netdata:
|
||||||
Log.debug(self, "Removing Netdata")
|
Log.debug(self, "Removing Netdata")
|
||||||
|
|||||||
Reference in New Issue
Block a user