diff options
author | ChatChimi <Pichue07@gmail.com> | 2020-03-28 16:45:42 +0100 |
---|---|---|
committer | ChatChimi <Pichue07@gmail.com> | 2020-03-28 16:45:42 +0100 |
commit | b1425fdb9b19ea1efd5dc405fe746789a511e58f (patch) | |
tree | 1000c2898d4cc3fbd8183893ac8b48e661854d64 | |
parent | 506db18260baefceded116bdfc6934eea0284428 (diff) |
Update BDDauto.sh
-rwxr-xr-x | automatisation/BDDAuto.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/automatisation/BDDAuto.sh b/automatisation/BDDAuto.sh index 3ec2490..61ff956 100755 --- a/automatisation/BDDAuto.sh +++ b/automatisation/BDDAuto.sh @@ -1,4 +1,6 @@ #!/bin/bash +#cloner dans le repertoire personnel du root +#exucuter en tant que root cp /root/ATS-Project/web/website/init-bd.sql /tmp/table.sql #Car problème de droit root @@ -14,4 +16,6 @@ echo "CREATE USER atsuser WITH PASSWORD '123456'; CREATE DATABASE atsdb; GRANT A su - postgres -c "psql -f /tmp/conf" -su - atsuser -c "psql -d atsdb -U atsuser -f /tmp/table.sql" + +pushd /tmp ; su atsuser -c "psql -d atsdb -U atsuser -f /tmp/table.sql" ; popd + |