From 2a7936714fe60ffae9d55292cffcae5f1ee6a1ad Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 13 Dec 2024 15:37:51 -0500 Subject: [PATCH] escape dollar signs --- devuitls.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/devuitls.sh b/devuitls.sh index 028003b..beb2420 100755 --- a/devuitls.sh +++ b/devuitls.sh @@ -2,22 +2,22 @@ servicename="$REPO_NAME" pw_developmentdatabase="wnmhOttjA0wCiR9hVoG7jjrf90SxWvAV" -connnectionstr="Host=localhost;Database=${servicename}_dev;Username=${servicename};Password=${pw_developmentdatabase};IncludeErrorDetail=true;" +connnectionstr="Host=localhost;Database=$${servicename}_dev;Username=$${servicename};Password=$${pw_developmentdatabase};IncludeErrorDetail=true;" -case "$1" in +case "$$1" in "initial") - sudo -u postgres psql -c "create database ${servicename}_dev;" - sudo -u postgres psql -c "create user $servicename with encrypted password '$pw_developmentdatabase';" - sudo -u postgres psql -c "grant all privileges on database ${servicename}_dev to $servicename;" - sudo -u postgres psql -d "${servicename}_dev" -c "GRANT ALL ON SCHEMA public TO $servicename" + sudo -u postgres psql -c "create database $${servicename}_dev;" + sudo -u postgres psql -c "create user $$servicename with encrypted password '$$pw_developmentdatabase';" + sudo -u postgres psql -c "grant all privileges on database $${servicename}_dev to $$servicename;" + sudo -u postgres psql -d "$${servicename}_dev" -c "GRANT ALL ON SCHEMA public TO $$servicename" ;; "dbupdate") - dotnet ef migrations add "$2" - dotnet ef database update --connection "$connnectionstr";; + dotnet ef migrations add "$$2" + dotnet ef database update --connection "$$connnectionstr";; *) - echo "Unknown command '$1', try 'initial'" ;; + echo "Unknown command '$$1', try 'initial'" ;; esac