display application credentials even when TOMCAT_PASSWORD is not specified

This commit is contained in:
Sameer Naik
2015-08-13 13:36:06 +05:30
parent 39ba0ff825
commit cc09b9d041
2 changed files with 9 additions and 1 deletions

View File

@@ -8,3 +8,11 @@ initialize_tomcat_webapps() {
ln -sf $BITNAMI_APP_DIR/webapps.defaults/$f /app/
done
}
print_tomcat_password() {
if [ -z $TOMCAT_PASSWORD ]; then
echo "**none**"
else
echo $TOMCAT_PASSWORD
fi
}

View File

@@ -17,8 +17,8 @@ if [ ! "$(ls -A $BITNAMI_APP_VOL_PREFIX/conf)" ]; then
echo ""
echo "Setting manager password in tomcat-users.xml ..."
sed -i 's/^<user username="manager" password=""/username="manager" password="'"$TOMCAT_PASSWORD"'"/' $BITNAMI_APP_VOL_PREFIX/conf/tomcat-users.xml
print_app_credentials $BITNAMI_APP_NAME manager $TOMCAT_PASSWORD
fi
print_app_credentials $BITNAMI_APP_NAME manager `print_tomcat_password`
else
print_container_already_initialized $BITNAMI_APP_NAME
fi