Skip to content

Commit

Permalink
only set values if RUNDECK_STORAGE_PASSWORD set
Browse files Browse the repository at this point in the history
  • Loading branch information
jjethwa authored Jan 9, 2023
1 parent 0a07bee commit 5d94180
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions content/opt/run
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ if [ ! -f "${initfile}" ]; then
RUNDECK_PASSWORD=${RUNDECK_PASSWORD:-$(pwgen -s 15 1)}
DATABASE_ADMIN_PASSWORD=${DATABASE_ADMIN_PASSWORD:-${RUNDECK_PASSWORD}}
DATABASE_ADMIN_USER=${DATABASE_ADMIN_USER:-rundeck}
RUNDECK_STORAGE_PASSWORD=${RUNDECK_STORAGE_PASSWORD:-$(pwgen -s 15 1)}
RUNDECK_STORAGE_PROVIDER=${RUNDECK_STORAGE_PROVIDER:-"db"}
NO_LOCAL_MYSQL=${NO_LOCAL_MYSQL:-"false"}
SKIP_DATABASE_SETUP=${SKIP_DATABASE_SETUP:-"false"}
Expand Down Expand Up @@ -303,15 +302,17 @@ if [ ! -f "${initfile}" ]; then
else
echo "rundeck.config.storage.converter.1.path=/" >> /etc/rundeck/rundeck-config.properties
fi
if grep -q rundeck.storage.converter.1.config.password /etc/rundeck/rundeck-config.properties ; then
sed -i 's/rundeck\.storage\.converter\.1\.config\.password.*$/rundeck\.storage\.converter\.1\.config\.password='${RUNDECK_STORAGE_PASSWORD}'/g' /etc/rundeck/rundeck-config.properties
else
echo "rundeck.storage.converter.1.config.password=${RUNDECK_STORAGE_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
fi
if grep -q rundeck.config.storage.converter.1.config.password /etc/rundeck/rundeck-config.properties ; then
sed -i 's/rundeck\.config\.storage\.converter\.1\.config\.password.*$/rundeck\.config\.storage\.converter\.1\.config\.password='${RUNDECK_STORAGE_PASSWORD}'/g' /etc/rundeck/rundeck-config.properties
else
echo "rundeck.config.storage.converter.1.config.password=${RUNDECK_STORAGE_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
if ! [ -z "${RUNDECK_STORAGE_PASSWORD}" ]; then
if grep -q rundeck.storage.converter.1.config.password /etc/rundeck/rundeck-config.properties ; then
sed -i 's/rundeck\.storage\.converter\.1\.config\.password.*$/rundeck\.storage\.converter\.1\.config\.password='${RUNDECK_STORAGE_PASSWORD}'/g' /etc/rundeck/rundeck-config.properties
else
echo "rundeck.storage.converter.1.config.password=${RUNDECK_STORAGE_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
fi
if grep -q rundeck.config.storage.converter.1.config.password /etc/rundeck/rundeck-config.properties ; then
sed -i 's/rundeck\.config\.storage\.converter\.1\.config\.password.*$/rundeck\.config\.storage\.converter\.1\.config\.password='${RUNDECK_STORAGE_PASSWORD}'/g' /etc/rundeck/rundeck-config.properties
else
echo "rundeck.config.storage.converter.1.config.password=${RUNDECK_STORAGE_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
fi
fi
fi

Expand Down

0 comments on commit 5d94180

Please sign in to comment.