feat: KIAUH v4.0.0 #191
@@ -16,16 +16,20 @@ set -e
|
|||||||
#===================================================#
|
#===================================================#
|
||||||
|
|
||||||
function remove_nginx() {
|
function remove_nginx() {
|
||||||
if [[ -f "${SYSTEMD}/nginx.service" ]]; then
|
if [[ $(dpkg -s nginx 2>/dev/null | grep "Status") = *\ installed ]]; then
|
||||||
status_msg "Stopping Nginx service ..."
|
status_msg "Stopping NGINX service ..."
|
||||||
sudo systemctl stop nginx && sudo systemctl disable nginx
|
if systemctl is-active nginx -q; then
|
||||||
ok_msg "Service stopped and disabled!"
|
sudo systemctl stop nginx && ok_msg "Service stopped!"
|
||||||
|
else
|
||||||
|
warn_msg "NGINX service not active!"
|
||||||
|
fi
|
||||||
|
|
||||||
status_msg "Purging Nginx from system ..."
|
status_msg "Removing NGINX from system ..."
|
||||||
sudo apt-get purge nginx nginx-common -y
|
if sudo apt-get remove nginx -y && sudo update-rc.d -f nginx remove; then
|
||||||
sudo update-rc.d -f nginx remove
|
ok_msg "NGINX removed!"
|
||||||
|
else
|
||||||
print_confirm "Nginx successfully removed!"
|
error_msg "Removing NGINX from system failed!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
print_error "Looks like Nginx was already removed!\n Skipping..."
|
print_error "Looks like Nginx was already removed!\n Skipping..."
|
||||||
fi
|
fi
|
||||||
@@ -167,7 +171,7 @@ function remove_conflicting_packages() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${haproxy} == "true" ]]; then
|
if [[ ${haproxy} == "true" ]]; then
|
||||||
status_msg "Removing haproxy ..."
|
status_msg "Removing haproxy from system ..."
|
||||||
if sudo apt-get remove haproxy -y && sudo update-rc.d -f haproxy remove; then
|
if sudo apt-get remove haproxy -y && sudo update-rc.d -f haproxy remove; then
|
||||||
ok_msg "Haproxy removed!"
|
ok_msg "Haproxy removed!"
|
||||||
else
|
else
|
||||||
@@ -216,9 +220,9 @@ function detect_conflicting_packages() {
|
|||||||
local apache="false" haproxy="false"
|
local apache="false" haproxy="false"
|
||||||
|
|
||||||
### check system for an installed apache2 service
|
### check system for an installed apache2 service
|
||||||
[[ $(dpkg-query -f'${Status}' --show apache2 2>/dev/null) = *\ installed ]] && apache="true"
|
[[ $(dpkg -s apache2 2>/dev/null | grep "Status") = *\ installed ]] && apache="true"
|
||||||
### check system for an installed haproxy service
|
### check system for an installed haproxy service
|
||||||
[[ $(dpkg-query -f'${Status}' --show haproxy 2>/dev/null) = *\ installed ]] && haproxy="true"
|
[[ $(dpkg -s haproxy 2>/dev/null | grep "Status") = *\ installed ]] && haproxy="true"
|
||||||
|
|
||||||
#notify user about haproxy or apache2 services found and possible issues
|
#notify user about haproxy or apache2 services found and possible issues
|
||||||
if [[ ${haproxy} == "false" && ${apache} == "false" ]]; then
|
if [[ ${haproxy} == "false" && ${apache} == "false" ]]; then
|
||||||
@@ -236,7 +240,7 @@ function detect_conflicting_packages() {
|
|||||||
echo -e "| Having those packages installed can lead to unwanted |"
|
echo -e "| Having those packages installed can lead to unwanted |"
|
||||||
echo -e "| behaviour. It's recommended to remove those packages. |"
|
echo -e "| behaviour. It's recommended to remove those packages. |"
|
||||||
echo -e "| |"
|
echo -e "| |"
|
||||||
echo -e "| 1) Remove packages (recommend) |"
|
echo -e "| ${green}1) Remove packages (recommend)${white} |"
|
||||||
echo -e "| 2) Disable only (may still cause issues) |"
|
echo -e "| 2) Disable only (may still cause issues) |"
|
||||||
echo -e "| ${red}3) Skip this step (not recommended)${white} |"
|
echo -e "| ${red}3) Skip this step (not recommended)${white} |"
|
||||||
bottom_border
|
bottom_border
|
||||||
|
|||||||
Reference in New Issue
Block a user