summaryrefslogtreecommitdiffstats
path: root/setup-zabbix-db.sh
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-08-24 04:49:47 +0200
committerLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-08-24 04:49:47 +0200
commitfc7ddd077cd9472b386bf0088cbff0919b4bc96f (patch)
tree54670434df437a8e4ddf4a3015b34032d4c9ceaf /setup-zabbix-db.sh
downloadzabbix-container-fc7ddd077cd9472b386bf0088cbff0919b4bc96f.tar.gz
zabbix-container-fc7ddd077cd9472b386bf0088cbff0919b4bc96f.tar.bz2
zabbix-container-fc7ddd077cd9472b386bf0088cbff0919b4bc96f.tar.lz
zabbix-container-fc7ddd077cd9472b386bf0088cbff0919b4bc96f.zip

feat: initial commit

Diffstat (limited to 'setup-zabbix-db.sh')
-rwxr-xr-xsetup-zabbix-db.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/setup-zabbix-db.sh b/setup-zabbix-db.sh
new file mode 100755
index 0000000..d867076
--- /dev/null
+++ b/setup-zabbix-db.sh
@@ -0,0 +1,9 @@
+#!/bin/zsh
+set -eax
+podman compose up -d postgres
+for f in /usr/share/zabbix/database/postgresql/schema.sql /usr/share/zabbix/database/postgresql/images.sql /usr/share/zabbix/database/postgresql/data.sql; do
+ f2="$(basename "$f")"
+ podman compose run -it --rm zabbix cat "$f" > "tmp.$f2" || (rm "tmp.$f2" && exit 1)
+ (cat "tmp.$f2" | podman compose exec -T postgres psql -U zabbix -f /proc/self/fd/0) || (rm "tmp.$f2" && exit 1)
+ rm "tmp.$f2"
+done