Skip to content

Commit df5ea01

Browse files
authored
switch to the new log level setting (#86)
1 parent d53a1f3 commit df5ea01

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

terraform/modules/gateway/setup.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ masquerade = ${nat}
114114
115115
# Optional: Set the priority of the Defguard forward chain
116116
#fw_priority = 0
117+
118+
log_level = "${log_level}"
117119
EOF
118120

119121
%{ if nat ~}
@@ -126,12 +128,6 @@ EOF
126128
grep -q -e '^net.ipv6.conf.all.forwarding' /etc/sysctl.conf || echo "net.ipv6.conf.all.forwarding = 1" | tee -a /etc/sysctl.conf
127129
%{ endif ~}
128130

129-
log "Setting log level in defguard-gateway service..."
130-
if grep -q '^Environment="RUST_LOG=' /lib/systemd/system/defguard-gateway.service; then
131-
sed -i "s|^Environment=\"RUST_LOG=.*\"|Environment=\"RUST_LOG=${log_level}\"|" /lib/systemd/system/defguard-gateway.service
132-
else
133-
sed -i "/^\[Service\]/a Environment=\"RUST_LOG=${log_level}\"" /lib/systemd/system/defguard-gateway.service
134-
fi
135131
log "Reloading systemd daemon to apply changes..."
136132
systemctl daemon-reload
137133

0 commit comments

Comments
 (0)