More improvement in aptget.py
This commit is contained in:
75
install
75
install
@@ -9,7 +9,7 @@
|
||||
# -------------------------------------------------------------------------
|
||||
# wget -qO wo wops.cc && sudo bash wo
|
||||
# -------------------------------------------------------------------------
|
||||
# Version 3.9.9.3 - 2019-10-08
|
||||
# Version 3.9.9.3 - 2019-10-11
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# CONTENTS
|
||||
@@ -126,7 +126,7 @@ if [ -z "$wo_travis" ]; then
|
||||
apt-get update -qq > /dev/null 2>&1
|
||||
fi
|
||||
if ! command_exists curl; then
|
||||
apt-get update -qq && apt-get -y install curl -qq > /dev/null 2>&1
|
||||
apt-get -y install curl -qq > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -171,13 +171,8 @@ WO_ARCH="$(uname -m)"
|
||||
|
||||
if [ -x /usr/local/bin/ee ]; then
|
||||
ee_migration=1
|
||||
ufw="n"
|
||||
elif [ -x /usr/local/bin/wo ]; then
|
||||
wo_upgrade=1
|
||||
ufw="n"
|
||||
fi
|
||||
if [ -z "$ufw" ]; then
|
||||
ufw="y"
|
||||
fi
|
||||
###
|
||||
# 1 - Checking linux distro
|
||||
@@ -689,66 +684,6 @@ wo_uninstall() {
|
||||
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates
|
||||
}
|
||||
|
||||
wo_ufw_setup() {
|
||||
if ! grep -q "ENABLED=yes" /etc/ufw/ufw.conf; then
|
||||
# get custom ssh port
|
||||
if [ -f /etc/ssh/sshd_config ]; then
|
||||
CURRENT_SSH_PORT=$(grep "Port" /etc/ssh/sshd_config | awk -F " " '{print $2}')
|
||||
fi
|
||||
# define firewall rules
|
||||
if ! grep -q "LOGLEVEL=low" /etc/ufw/ufw.conf; then
|
||||
ufw logging low
|
||||
fi
|
||||
if ! grep -q 'DEFAULT_OUTPUT_POLICY="ACCEPT"' /etc/default/ufw; then
|
||||
ufw default allow outgoing
|
||||
fi
|
||||
if ! grep -q 'DEFAULT_INPUT_POLICY="DROP"' /etc/default/ufw; then
|
||||
ufw default deny incoming
|
||||
fi
|
||||
if ! grep -q "\-\-dport 22 -j" /etc/ufw/user.rules; then
|
||||
# default ssh port
|
||||
ufw limit 22
|
||||
fi
|
||||
|
||||
# custom ssh port
|
||||
if [ "$CURRENT_SSH_PORT" != "22" ]; then
|
||||
if ! grep -q "\-\-dport $CURRENT_SSH_PORT -j" /etc/ufw/user.rules; then
|
||||
ufw limit "$CURRENT_SSH_PORT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# nginx
|
||||
if ! grep -q "\-\-dport 80 -j" /etc/ufw/user.rules; then
|
||||
# http
|
||||
ufw allow http
|
||||
fi
|
||||
if ! grep -q "\-\-dport 443 -j" /etc/ufw/user.rules; then
|
||||
# https
|
||||
ufw allow https
|
||||
fi
|
||||
|
||||
# ntp
|
||||
if ! grep -q "\-\-dport 123 -j" /etc/ufw/user.rules; then
|
||||
ufw allow 123
|
||||
fi
|
||||
|
||||
if ! grep -q "\-\-dport 22222 -j" /etc/ufw/user.rules; then
|
||||
# wordops backend
|
||||
ufw limit 22222
|
||||
fi
|
||||
# enable ufw
|
||||
if [ -n "$CURRENT_SSH_PORT" ]; then
|
||||
ufw --force enable
|
||||
fi
|
||||
|
||||
# remove ufw from syslog
|
||||
if [ -f /etc/rsyslog.d/20-ufw.conf ]; then
|
||||
sed -i 's/\#\& stop/\& stop/' /etc/rsyslog.d/20-ufw.conf
|
||||
service rsyslog restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
wo_cheat_install() {
|
||||
curl -sL https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
|
||||
chmod +x /usr/local/bin/cht.sh
|
||||
@@ -793,9 +728,6 @@ else
|
||||
fi
|
||||
_run wo_install_dep "Installing wo dependencies"
|
||||
_run wo_timesync
|
||||
#if [ "$ufw" = "y" ]; then
|
||||
# _run wo_ufw_setup "Configuring UFW"
|
||||
#fi
|
||||
# skip steps if travis
|
||||
if [ -z "$wo_travis" ]; then
|
||||
_run wo_dist_upgrade
|
||||
@@ -860,6 +792,3 @@ else
|
||||
wo_lib_echo "Give WordOps a GitHub star : https://github.com/WordOps/WordOps/"
|
||||
echo
|
||||
fi
|
||||
# if [ -z "$wo_travis" ]; then
|
||||
# /bin/bash --init-file "/var/lib/wo/tmp/WordOps-$wo_branch/tests/init-file"
|
||||
# fi
|
||||
|
||||
Reference in New Issue
Block a user