Skip to content

Commit 24c245d

Browse files
authored
Update preinstall.sh
Updating output messages
1 parent 4a0c70a commit 24c245d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/packages/preinstall.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,22 @@ update_config_file() {
4747
echo "Checking what version of NGINX Agent is already installed"
4848
check_version="nginx-agent --version"
4949
nginx_agent_version=$($check_version 2>&1) || true
50+
echo "Existing NGINX Agent version: $nginx_agent_version"
5051

5152
if [ -z "${nginx_agent_version##nginx-agent version v2*}" ]; then
52-
echo "Updating NGINX Agent V2 configuration to V3 configuration"
53-
echo "Backing up NGINX Agent V2 configuration to /etc/nginx-agent/nginx-agent-v2-backup.conf"
53+
echo "Migrating NGINX Agent configuration from V2 to V3 format"
54+
echo "Backing up existing NGINX Agent V2 configuration to /etc/nginx-agent/nginx-agent-v2-backup.conf"
5455
cp "$AGENT_CONFIG_FILE" /etc/nginx-agent/nginx-agent-v2-backup.conf
5556

5657
v2_config_file=$AGENT_CONFIG_FILE
5758
v3_config_file=$AGENT_CONFIG_FILE
5859

59-
echo "NGINX Agent server host should be ${NGINX_ONE_HOST}"
60+
echo "Verifying configured NGINX One host: ${NGINX_ONE_HOST}"
6061

6162
if grep -q "$NGINX_ONE_HOST" "$v2_config_file"; then
6263
echo "NGINX Agent is configured to connect to NGINX One"
6364
else
64-
echo "${RED_COLOUR}Previous version of NGINX Agent was not configured to connect to NGINX One. Stopping upgrade${NO_COLOUR}"
65+
echo "${RED_COLOUR}Upgrade aborted: existing Agent V2 is not configured for NGINX One.${NO_COLOUR}"
6566
exit 1
6667
fi
6768

@@ -75,7 +76,7 @@ update_config_file() {
7576

7677
labels=""
7778
if [ -n "$instance_group" ]; then
78-
echo "Adding config sync group to NGINX Agent configuration"
79+
echo "Migrating existing config sync group into NGINX Agent V3 configuration"
7980
labels="
8081
labels:
8182
config-sync-group: ${instance_group}

0 commit comments

Comments
 (0)