From 1c6d57373a63cb84e980625410c6c79425f91129 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 22 May 2024 09:51:12 +0200 Subject: [PATCH 1/2] Checkd lower and upper user aproval --- pandora_server/pandora_server_installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index c3682a9a45..50c12f2b36 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -206,14 +206,14 @@ install () { echo -e -n "Files from a previous installation were found in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE}. " read -p "That directory will be deleted in order to preserve integrity. Do you wish to proceed? (y/N): " USERAPPROVAL - if [ "${USERAPPROVAL,,}" = "y" ]; then + if [ "$USERAPPROVAL" == "y" ] || [ "$USERAPPROVAL" == "Y" ]; then rm -rf "/usr/lib/perl5/PandoraFMS" echo -e "Previous PandoraFMS directory deleted successfully" else echo -e -n "Files in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE} will not be deleted. This may cause issues. " read -p "Do you want to proceed with the installation anyway? (y/N): " USERAPPROVAL - if [ "${USERAPPROVAL,,}" = "y" ]; then + if [ "$USERAPPROVAL" == "y" ] || [ "$USERAPPROVAL" == "Y" ]; then echo "Proceeding with the installation anyway. This may cause problems in the future due to the existence of files from previous installations." else echo "Installation aborted. You chose not to proceed." From bc3397bf18df7f931add118500b193e62723a38e Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 22 May 2024 15:40:42 +0200 Subject: [PATCH 2/2] Adapted comparision for bash and sh --- pandora_server/pandora_server_installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 50c12f2b36..1f9c0f4d03 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -206,14 +206,14 @@ install () { echo -e -n "Files from a previous installation were found in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE}. " read -p "That directory will be deleted in order to preserve integrity. Do you wish to proceed? (y/N): " USERAPPROVAL - if [ "$USERAPPROVAL" == "y" ] || [ "$USERAPPROVAL" == "Y" ]; then + if [ "$USERAPPROVAL" = "y" ] || [ "$USERAPPROVAL" = "Y" ]; then rm -rf "/usr/lib/perl5/PandoraFMS" echo -e "Previous PandoraFMS directory deleted successfully" else echo -e -n "Files in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE} will not be deleted. This may cause issues. " read -p "Do you want to proceed with the installation anyway? (y/N): " USERAPPROVAL - if [ "$USERAPPROVAL" == "y" ] || [ "$USERAPPROVAL" == "Y" ]; then + if [ "$USERAPPROVAL" = "y" ] || [ "$USERAPPROVAL" = "Y" ]; then echo "Proceeding with the installation anyway. This may cause problems in the future due to the existence of files from previous installations." else echo "Installation aborted. You chose not to proceed."