ubuntu-2204-graylog/0055-configure-graylog.sh

19 lines
713 B
Bash
Raw Permalink Normal View History

2024-01-08 00:49:41 +02:00
#!/usr/bin/env bash
CONFIG_FILE="/etc/graylog/server/server.conf"
RANDOM_PW=$(pwgen -N 1 -s 96)
sed -i -e "s@^password_secret =.*@password_secret = ${RANDOM_PW}@g" \
-e "s@^#http_bind_address = 127.0.0.1:9000@http_bind_address = 0.0.0.0:9000@g" \
-e "s@^http_bind_address = .*@http_bind_address = 0.0.0.0:9000@g" \
-e "s@^root_password_sha2 =.*@root_password_sha2 = 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918@" \
-e "s@^#elasticsearch_hosts =.*@elasticsearch_hosts = http://127.0.0.1:9200@g" \
-e "s@^elasticsearch_hosts =.*@elasticsearch_hosts = http://127.0.0.1:9200@g" \
"${CONFIG_FILE}"
systemctl daemon-reload
systemctl restart graylog-server
systemctl enable graylog-server