Skip to content

Instantly share code, notes, and snippets.

@onefoursix
Created March 18, 2020 21:04
Show Gist options
  • Save onefoursix/91b96dc2e831628e18b1c9f5fae7d689 to your computer and use it in GitHub Desktop.
Save onefoursix/91b96dc2e831628e18b1c9f5fae7d689 to your computer and use it in GitHub Desktop.
Script to set database connection info in *-app.properties files for StreamSets Control Hub
declare -a dbs=("jobrunner" "messaging" "notification" "pipelinestore" "policy" "provisioning" "reporting" "scheduler" "sdp_classification" "security" "sla" "timeseries" "topology" "dynamic_preview")
for i in "${dbs[@]}"
do
sed -i "s/^db.openjpa.ConnectionURL=/db.openjpa.ConnectionURL=jdbc\:mysql\:\/\/localhost:3306\/${i}?useSSL=false/" ${i}-app.properties
sed -i "s/^db.openjpa.ConnectionUserName=/db.openjpa.ConnectionUserName=sch/" ${i}-app.properties
sed -i "s/^db.openjpa.ConnectionPassword=/db.openjpa.ConnectionPassword=Mysql12345!/" ${i}-app.properties
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment