diff options
Diffstat (limited to 'automatisation')
-rwxr-xr-x | automatisation/BDDAuto.sh | 17 | ||||
-rw-r--r-- | automatisation/txt | 0 |
2 files changed, 17 insertions, 0 deletions
diff --git a/automatisation/BDDAuto.sh b/automatisation/BDDAuto.sh new file mode 100755 index 0000000..3ec2490 --- /dev/null +++ b/automatisation/BDDAuto.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +cp /root/ATS-Project/web/website/init-bd.sql /tmp/table.sql #Car problème de droit root + +apt install postgresql + +useradd atsuser + +echo atsuser:123456 | chpasswd + + +echo "CREATE USER atsuser WITH PASSWORD '123456'; CREATE DATABASE atsdb; GRANT ALL PRIVILEGES ON DATABASE atsdb to atsuser;" > /tmp/conf + + +su - postgres -c "psql -f /tmp/conf" + +su - atsuser -c "psql -d atsdb -U atsuser -f /tmp/table.sql" diff --git a/automatisation/txt b/automatisation/txt deleted file mode 100644 index e69de29..0000000 --- a/automatisation/txt +++ /dev/null |