fix only essential qoutes

This commit is contained in:
orenshor
2025-11-12 09:51:45 +02:00
parent 9e79e65e25
commit a72025bc94

View File

@@ -20,9 +20,9 @@ active_watchdog_pid=
cleanup() {
local signal="$1"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Signal ${signal} was received, exiting gracefully..." >&2
if [ -n "${active_watchdog_pid}" ] && ps -p "${active_watchdog_pid}" > /dev/null 2>&1; then
kill -TERM "${active_watchdog_pid}" 2>/dev/null || true
wait "${active_watchdog_pid}" 2>/dev/null || true
if [ -n "${active_watchdog_pid}" ] && ps -p ${active_watchdog_pid} > /dev/null 2>&1; then
kill -TERM ${active_watchdog_pid} 2>/dev/null || true
wait ${active_watchdog_pid} 2>/dev/null || true
fi
echo "Cleanup completed. Exiting now." >&2
exit 0
@@ -31,7 +31,7 @@ cleanup() {
trap 'cleanup SIGTERM' SIGTERM
trap 'cleanup SIGINT' SIGINT
if [ ! -f "/nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT" ]; then
if [ ! -f /nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT ]; then
echo "Error: agent installation package doesn't exist."
exit 1
fi
@@ -88,31 +88,31 @@ if [ -n "$var_ignore" ]; then
fi
"/nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT" --install $orchestration_service_installation_flags
/nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT --install $orchestration_service_installation_flags
if [ -f "/var/run/secrets/kubernetes.io/serviceaccount/token" ]; then
if [ -f /var/run/secrets/kubernetes.io/serviceaccount/token ]; then
/etc/cp/orchestration/k8s-check-update-listener.sh &
fi
"/nano-service-installers/$ATTACHMENT_REGISTRATION_SERVICE" --install
"/nano-service-installers/$CACHE_INSTALLATION_SCRIPT" --install
"/nano-service-installers/$HTTP_TRANSACTION_HANDLER_SERVICE" --install
/nano-service-installers/$ATTACHMENT_REGISTRATION_SERVICE --install
/nano-service-installers/$CACHE_INSTALLATION_SCRIPT --install
/nano-service-installers/$HTTP_TRANSACTION_HANDLER_SERVICE --install
if [ "$PROMETHEUS" == "true" ]; then
"/nano-service-installers/$PROMETHEUS_INSTALLATION_SCRIPT" --install
/nano-service-installers/$PROMETHEUS_INSTALLATION_SCRIPT --install
fi
if [ "$CENTRAL_NGINX_MANAGER" == "true" ]; then
"/nano-service-installers/$NGINX_CENTRAL_MANAGER_INSTALLATION_SCRIPT" --install
/nano-service-installers/$NGINX_CENTRAL_MANAGER_INSTALLATION_SCRIPT --install
fi
if [ "$CROWDSEC_ENABLED" == "true" ]; then
"/nano-service-installers/$INTELLIGENCE_INSTALLATION_SCRIPT" --install
"/nano-service-installers/$CROWDSEC_INSTALLATION_SCRIPT" --install
/nano-service-installers/$INTELLIGENCE_INSTALLATION_SCRIPT --install
/nano-service-installers/$CROWDSEC_INSTALLATION_SCRIPT --install
fi
# use advanced model if exist as data for agent
FILE="/advanced-model/open-appsec-advanced-model.tgz"
FILE=/advanced-model/open-appsec-advanced-model.tgz
if [ -f "$FILE" ]; then
tar -xzvf "$FILE" -C /etc/cp/conf/waap
fi
@@ -121,11 +121,11 @@ touch /etc/cp/watchdog/wd.startup
/etc/cp/watchdog/cp-nano-watchdog >/dev/null 2>&1 &
active_watchdog_pid=$!
while true; do
if [ -f "/tmp/restart_watchdog" ]; then
if [ -f /tmp/restart_watchdog ]; then
rm -f /tmp/restart_watchdog
kill -9 "${active_watchdog_pid}"
kill -9 ${active_watchdog_pid}
fi
if [ ! "$(ps -f | grep cp-nano-watchdog | grep "${active_watchdog_pid}")" ]; then
if [ ! "$(ps -f | grep cp-nano-watchdog | grep ${active_watchdog_pid})" ]; then
/etc/cp/watchdog/cp-nano-watchdog >/dev/null 2>&1 &
active_watchdog_pid=$!
fi