2 # Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # Deletes IP address(es) from a container running SuSE.
22 IFCFG_DIR=/etc/sysconfig/interfaces/
23 IFCFG="${IFCFG_DIR}/ifcfg-${VENET_DEV}"
29 if [ "x${IPDELALL}" = "xyes" ]; then
30 ifdown ${VENET_DEV} 2>/dev/null
31 rm -f ${IFCFG} 2>/dev/null
34 for ipm in ${IP_ADDR}; do
36 ids=`grep -E "^IPADDR.*=${_IP}$" ${IFCFG} 2>/dev/null |
37 sed 's/^IPADDR\(.*\)=.*/\1/'`
39 sed -e "/^IPADDR${id}=/ d " < ${IFCFG} > ${IFCFG}.bak && mv -f ${IFCFG}.bak ${IFCFG}
40 #ifconfig ${VENET_DEV}:${id} down 2>/dev/null
41 ip addr del ${IP_ADDR} dev ${VENET_DEV} 2>/dev/null