From 5cd25df19072f821cfd15bcda37e143f9441fec7 Mon Sep 17 00:00:00 2001 From: earnolmartin Date: Mon, 23 Oct 2023 14:31:19 -0600 Subject: [PATCH] Remove sites-enabled symlink since EHCP Force uses its own templates, and this file no longer is a symlink later, so it should not be a symlink right off the bat --- ehcp/ehcpforceupdate.sh | 20 ++++++++++++++++++++ ehcp/install_main.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/ehcp/ehcpforceupdate.sh b/ehcp/ehcpforceupdate.sh index 7adee11..648fc76 100755 --- a/ehcp/ehcpforceupdate.sh +++ b/ehcp/ehcpforceupdate.sh @@ -3468,6 +3468,26 @@ function createSymlinks(){ if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin" fi + + # Remove some symlinks that can break things depending on certain situations + + # Nginx + # Remove /etc/nginx/sites-enabled/default symlink if exists + if [ -L "/etc/nginx/sites-enabled/default" ]; then + rm -f "/etc/nginx/sites-enabled/default" + if [ -e "/etc/nginx/sites-available/default" ]; then + cp "/etc/nginx/sites-available/default" "/etc/nginx/sites-enabled/default" + fi + fi + + #Apache2 + # Remove /etc/apache2/sites-enabled/default symlink if exists + if [ -L "/etc/apache2/sites-enabled/default" ]; then + rm -f "/etc/apache2/sites-enabled/default" + if [ -e "/etc/apache2/sites-available/default" ]; then + cp "/etc/apache2/sites-available/default" "/etc/apache2/sites-enabled/default" + fi + fi } function preventUserCronFromWebUser(){ diff --git a/ehcp/install_main.sh b/ehcp/install_main.sh index 70cab09..64e6617 100755 --- a/ehcp/install_main.sh +++ b/ehcp/install_main.sh @@ -3131,6 +3131,26 @@ function createSymlinks(){ if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin" fi + + # Remove some symlinks that can break things depending on certain situations + + # Nginx + # Remove /etc/nginx/sites-enabled/default symlink if exists + if [ -L "/etc/nginx/sites-enabled/default" ]; then + rm -f "/etc/nginx/sites-enabled/default" + if [ -e "/etc/nginx/sites-available/default" ]; then + cp "/etc/nginx/sites-available/default" "/etc/nginx/sites-enabled/default" + fi + fi + + #Apache2 + # Remove /etc/apache2/sites-enabled/default symlink if exists + if [ -L "/etc/apache2/sites-enabled/default" ]; then + rm -f "/etc/apache2/sites-enabled/default" + if [ -e "/etc/apache2/sites-available/default" ]; then + cp "/etc/apache2/sites-available/default" "/etc/apache2/sites-enabled/default" + fi + fi } function preventUserCronFromWebUser(){