diff options
author | Adam Warner <me@adamwarner.co.uk> | 2020-11-19 00:56:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 00:56:08 +0300 |
commit | 1c2c10c4a5fdf9b7f66d35cc155e9642f29c5dbb (patch) | |
tree | 08c8bed3f2bd16be78147fa65a93c4b001964efa /advanced/Scripts/webpage.sh | |
parent | e03585e0bb081ae3fe7be45914f5b4b404e40d9d (diff) | |
parent | 8041bbf44390bd25be3471ed363d73a0dacf9a55 (diff) |
Merge pull request #3761 from BastiG/development
read REV_SERVER_CIDR from environment
Diffstat (limited to 'advanced/Scripts/webpage.sh')
-rwxr-xr-x | advanced/Scripts/webpage.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 8aaaa85a..15471ad4 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -226,17 +226,20 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423 REV_SERVER_TARGET="${CONDITIONAL_FORWARDING_IP}" add_setting "REV_SERVER_TARGET" "${REV_SERVER_TARGET}" + REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}" + if [ -z "${REV_SERVER_CIDR}" ]; then + # Convert existing input to /24 subnet (preserves legacy behavior) + # This sed converts "192.168.1.2" to "192.168.1.0/24" + # shellcheck disable=2001 + REV_SERVER_CIDR="$(sed "s+\\.[0-9]*$+\\.0/24+" <<< "${REV_SERVER_TARGET}")" + fi + add_setting "REV_SERVER_CIDR" "${REV_SERVER_CIDR}" + # Remove obsolete settings from setupVars.conf delete_setting "CONDITIONAL_FORWARDING" delete_setting "CONDITIONAL_FORWARDING_REVERSE" delete_setting "CONDITIONAL_FORWARDING_DOMAIN" delete_setting "CONDITIONAL_FORWARDING_IP" - - # Convert existing input to /24 subnet (preserves legacy behavior) - # This sed converts "192.168.1.2" to "192.168.1.0/24" - # shellcheck disable=2001 - REV_SERVER_CIDR="$(sed "s+\\.[0-9]*$+\\.0/24+" <<< "${REV_SERVER_TARGET}")" - add_setting "REV_SERVER_CIDR" "${REV_SERVER_CIDR}" fi if [[ "${REV_SERVER}" == true ]]; then |