From: Michael Tremer Date: Sat, 10 Jul 2010 17:56:44 +0000 (+0200) Subject: network: Add possibility to remove ports from zone of type bridge. X-Git-Tag: 001~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c077c723d7c2ce069d813254c6a632d48bd13114;p=network.git network: Add possibility to remove ports from zone of type bridge. --- diff --git a/hooks/zones/bridge.ports/ethernet b/hooks/zones/bridge.ports/ethernet index 1bef3590..f7dd5064 100755 --- a/hooks/zones/bridge.ports/ethernet +++ b/hooks/zones/bridge.ports/ethernet @@ -68,6 +68,30 @@ function _edit() { _add $@ } +function _rem() { + local zone=${1} + local port=${2} + + assert isset zone + assert isset port + + assert zone_exists ${zone} + + if ! listmatch ${port} $(zone_get_ports ${zone}); then + error "Port '${port}' does not belong to '${zone}'." + error "Won't remove anything." + exit ${EXIT_ERROR} + fi + + if port_exists ${port}; then + ( _down ${zone} ${port} ) + fi + + rm -f $(zone_dir ${zone})/ports/${port} + + exit ${EXIT_OK} +} + function _up() { local zone=${1} local port=${2}