From 2ec30f9ae4604fcd33251ba5521d1714b7be9759 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 19 Aug 2015 10:59:38 +0200 Subject: [PATCH] Change script of uninstall agent. Tiquet: #2357 if dont found satellite conf and server conf, delete pandora config dir. (cherry picked from commit 5736e3a48dfe9d9ee7c1bd9444588eccc90fd081) --- pandora_agents/shellscript/aix/pandora_agent_installer | 8 +++++++- pandora_agents/shellscript/hp-ux/pandora_agent_installer | 8 +++++++- pandora_agents/unix/pandora_agent_installer | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_agents/shellscript/aix/pandora_agent_installer b/pandora_agents/shellscript/aix/pandora_agent_installer index d976b6447c..4515cb6e5c 100755 --- a/pandora_agents/shellscript/aix/pandora_agent_installer +++ b/pandora_agents/shellscript/aix/pandora_agent_installer @@ -43,7 +43,13 @@ uninstall () { echo "Removing Pandora Agent..." rm -Rf $PANDORA_BIN rm -Rf $PANDORA_TEMP - rm -Rf $PANDORA_CFG + + # Skip delete of /etc/pandora if exists configuration of a server or satellite + if [ ! -f $PANDORA_CFG/pandora_server.conf -a ! -f $PANDORA_CFG/satellite_server.conf ] + then + rm -Rf $PANDORA_CFG + fi + rm -Rf $PANDORA_STARTUP rm -Rf $PANDORA_HOME rm -Rf $PANDORA_LOG diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent_installer b/pandora_agents/shellscript/hp-ux/pandora_agent_installer index c57744c33c..31a3c14e66 100755 --- a/pandora_agents/shellscript/hp-ux/pandora_agent_installer +++ b/pandora_agents/shellscript/hp-ux/pandora_agent_installer @@ -43,7 +43,13 @@ uninstall () { echo "Removing Pandora Agent..." rm -Rf $PANDORA_BIN rm -Rf $PANDORA_TEMP - rm -Rf $PANDORA_CFG + + # Skip delete of /etc/pandora if exists configuration of a server or satellite + if [ ! -f $PANDORA_CFG/pandora_server.conf -a ! -f $PANDORA_CFG/satellite_server.conf ] + then + rm -Rf $PANDORA_CFG 2> /dev/null + fi + rm -Rf $PANDORA_STARTUP rm -Rf $PANDORA_HOME rm -Rf $PANDORA_LOG diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index cf557aefb1..0999329d9a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -197,8 +197,8 @@ uninstall () { rm -Rf $PANDORA_BASE$PANDORA_MAN/{man1,cat1}/tentacle_client.1.gz 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_MAN/{man1,cat1}/pandora_agent.1.gz 2> /dev/null - # Skip delete of /etc/pandora if exists configuration of a server - if [ ! -f $PANDORA_BASE/$PANDORA_CFG/pandora_server.conf ] + # Skip delete of /etc/pandora if exists configuration of a server or satellite + if [ ! -f $PANDORA_BASE/$PANDORA_CFG/pandora_server.conf -a ! -f $PANDORA_BASE/$PANDORA_CFG/satellite_server.conf ] then rm -Rf $PANDORA_BASE/$PANDORA_CFG 2> /dev/null fi