fix: Hide sysctl output

This commit is contained in:
Kroese 2024-04-29 19:31:06 +02:00 committed by GitHub
parent c5fd776a9f
commit c199ff1dfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,8 +119,8 @@ configureNAT() {
# Check port forwarding flag
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
{ sysctl -w net.ipv4.ip_forward=1 ; rc=$?; } || :
if (( rc != 0 )); then
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1" && exit 24
fi
fi