aboutsummaryrefslogtreecommitdiff
path: root/automatisation
diff options
context:
space:
mode:
authorChatChimi <Pichue07@gmail.com>2020-03-28 16:18:39 +0100
committerChatChimi <Pichue07@gmail.com>2020-03-28 16:18:39 +0100
commit506db18260baefceded116bdfc6934eea0284428 (patch)
tree70552eb83d624441ea2759779186e838fa7ff0aa /automatisation
parent3453a6f9ddcf2bf55152852b892d5f3c03652656 (diff)
script autoBdd
Diffstat (limited to 'automatisation')
-rwxr-xr-xautomatisation/BDDAuto.sh17
-rw-r--r--automatisation/txt0
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