Update bonus.fints.sh: set default encrypted FinTS PIN within dbsetup.sql

This commit is contained in:
Martin Berger 2023-05-16 20:51:54 +02:00 committed by GitHub
parent 9f6326d127
commit 1375cec93a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -251,6 +251,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo mariadb -e "GRANT ALL PRIVILEGES ON fints.* TO 'fintsuser' IDENTIFIED BY 'fints';"
sudo mariadb -e "FLUSH PRIVILEGES;"
if [ -f "dbsetup.sql" ]; then
# set default encrypted PIN 123456789 within dbsetup.sql if not yet set
sudo sed -i -e "s/REPLACE_ENCRYPTED_PIN/$(mvn compile exec:java -Dexec.mainClass="net.petafuel.fuelifints.cryptography.aesencryption.AESUtil" -Dexec.args=123456789 -q)/g" dbsetup.sql
mariadb -ufintsuser -pfints fints < dbsetup.sql
else
echo "# FAIL - dbsetup.sql not found - deleting code & exit"