Mercurial > gemma
comparison schema/install-db.sh @ 436:8feb64128c34
Fixed install db script to cope with user roles containing whitespace.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 20 Aug 2018 17:58:56 +0200 |
parents | 88aa790d1437 |
children | 5611cf72cc92 |
comparison
equal
deleted
inserted
replaced
435:7d2afdc263b5 | 436:8feb64128c34 |
---|---|
126 # Evil mode: drop everything gemma | 126 # Evil mode: drop everything gemma |
127 echo "Really drop database '$db' and all gemma roles? [type 'yes']: " | 127 echo "Really drop database '$db' and all gemma roles? [type 'yes']: " |
128 read a | 128 read a |
129 if [[ $a == "yes" ]] ; then | 129 if [[ $a == "yes" ]] ; then |
130 dropdb -p "$port" "$db" | 130 dropdb -p "$port" "$db" |
131 for r in `psql -p $port -t -c '\du' | awk -F '|' \ | 131 psql -p $port -A -t -c '\du' | awk -F '|' -v port=$port \ |
132 '$1 "." $3 ~ /waterway_user|waterway_admin|sys_admin|pw_reset/ \ | 132 '$1 "." $3 ~ /waterway_user|waterway_admin|sys_admin|pw_reset/ \ |
133 {print $1}'` | 133 { system("dropuser -p " port " \"" $1 "\"") }' |
134 do | |
135 dropuser -p "$port" "$r" | |
136 done | |
137 else | 134 else |
138 echo "No harm done." | 135 echo "No harm done." |
139 fi | 136 fi |
140 fi | 137 fi |