[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipfire-development
Subject:    [PATCH 2/3] ipv4-static: Remove routing information from databases when shutting down a zone.
From:       Stefan Schantl <stefan.schantl () ipfire ! org>
Date:       2017-01-25 13:48:20
Message-ID: 20170125134821.15442-2-stefan.schantl () ipfire ! org
[Download RAW message or body]

Otherwise the script will try to use this route again and crash because the address space
is not longer available.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 src/hooks/configs/ipv4-static | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/hooks/configs/ipv4-static b/src/hooks/configs/ipv4-static
index 72b748c..cb00252 100644
--- a/src/hooks/configs/ipv4-static
+++ b/src/hooks/configs/ipv4-static
@@ -147,7 +147,10 @@ hook_down() {
 		error "Zone '${zone}' doesn't exist."
 		exit ${EXIT_ERROR}
 	fi
-	
+
+	# Remove routing information from database.
+	db_delete "${zone}/ipv4"
+
 	zone_config_settings_read "${zone}" "${config}"
 
 	ip_address_del ${zone} ${ADDRESS}/${PREFIX}
-- 
2.9.3

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic