-
Notifications
You must be signed in to change notification settings - Fork 15
/
install.sh
executable file
·30 lines (26 loc) · 1.12 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
. functions.sh
. deps.sh
./install-k3s.sh
./install-loki.sh
./install-grafana.sh
if [[ "$(config_val 'baseDomain')" == "" ]]; then
IP=$(ip -f inet addr show "$(ip route get 8.8.8.8 | sed -n 's/.*dev \([^\ ]*\).*/\1/p')" | sed -En -e 's/.*inet ([0-9.]+).*/\1/p')
LOKI_URL="$IP:$(config_val 'loki.exposedPort')"
GRAFANA_URL="$IP:$(config_val 'grafana.exposedPort')"
PROTOCOL="http"
else
LOKI_URL="loki.$(config_val 'baseDomain')"
GRAFANA_URL="grafana.$(config_val 'baseDomain')"
PROTOCOL="https"
fi
{
printf 'Service\tURL\tUsername\tPassword\n';
printf '%s\t%s\t%s\t%s\n' "Loki" ${PROTOCOL}://${LOKI_URL} $(config_val "loki.username") $(config_val "loki.password");
printf '%s\t%s\t%s\t%s\n' "Grafana" ${PROTOCOL}://${GRAFANA_URL} $(config_val "grafana.username") $(config_val "grafana.password");
} | prettytable 4
printf "You can now add the following to your server.cfg in order to configure ox_lib Logger:\n\n"
echo "set ox:logger \"loki\""
echo "set loki:user \"$(config_val 'loki.username')\""
echo "set loki:password \"$(config_val 'loki.password')\""
echo "set loki:endpoint \"${PROTOCOL}://${LOKI_URL}\""