kolaente
2f18d0cbad
All checks were successful
continuous-integration/drone/push Build is passing
Resolves https://community.vikunja.io/t/helm-chart-frontend-pod-does-not-start-because-of-permission-issues-in-raspberry-pie-4-k3s/1286
20 lines
694 B
Bash
Executable File
20 lines
694 B
Bash
Executable File
#!/usr/bin/env sh
|
|
set -e
|
|
|
|
if [ ! -f "/proc/net/if_inet6" ]; then
|
|
echo "info: IPv6 is not available! Removing IPv6 listen configuration"
|
|
find /etc/nginx/conf.d -name '*.conf' -type f | \
|
|
while IFS= read -r CONFIG; do
|
|
sed -r '/^\s*listen\s*\[::\]:.+$/d' "$CONFIG" > "$CONFIG.temp"
|
|
if ! diff -U 5 "$CONFIG" "$CONFIG.temp" > "$CONFIG.diff"; then
|
|
echo "info: Removing IPv6 lines from $CONFIG" | \
|
|
cat - "$CONFIG.diff"
|
|
echo "# IPv6 is disabled because /proc/net/if_inet6 was not found" | \
|
|
cat - "$CONFIG.temp" > "$CONFIG"
|
|
else
|
|
echo "info: Skipping $CONFIG because it does not have IPv6 listen"
|
|
fi
|
|
rm -f "$CONFIG.temp" "$CONFIG.diff"
|
|
done
|
|
fi
|