wok-6.x annotate vzctl/stuff/slitaz-del_ip.sh @ rev 18233

linld: add tobzimage (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 23 12:23:11 2015 +0200 (2015-07-23)
parents
children
rev   line source
erjo@8056 1 #!/bin/bash
erjo@8056 2 # Deletes IP address from a container running SliTaz distro.
erjo@8056 3 #
erjo@8056 4 # This program is free software; you can redistribute it and/or modify
erjo@8056 5 # it under the terms of the GNU General Public License as published by
erjo@8056 6 # the Free Software Foundation; either version 2 of the License, or
erjo@8056 7 # (at your option) any later version.
erjo@8056 8 #
erjo@8056 9 # This program is distributed in the hope that it will be useful,
erjo@8056 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
erjo@8056 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
erjo@8056 12 # GNU General Public License for more details.
erjo@8056 13 #
erjo@8056 14 # You should have received a copy of the GNU General Public License
erjo@8056 15 # along with this program; if not, write to the Free Software
erjo@8056 16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
erjo@8056 17 #
erjo@8056 18 # Copyright (C) 2011 Eric Joseph-Alexandre <erjo@slitaz.org>
erjo@8056 19
erjo@8056 20
erjo@8056 21 VENET_DEV=eth0
erjo@8056 22 CFGFILE=/etc/network.conf
erjo@8056 23
erjo@8056 24 # Function to delete IP address
erjo@8056 25 function del_ip()
erjo@8056 26 {
erjo@8056 27 if grep -q ${IP_ADDR} ${CFGFILE}; then
erjo@8056 28 sed -i 's/^IP.*/IP=\"0\"/' ${CFGFILE}
erjo@8056 29 fi
erjo@8056 30
erjo@8056 31 # Shutting down $VENET_DEV if CT is running.
erjo@8056 32 if [ "$VE_STATE" = "running" ]; then
erjo@8056 33 /sbin/ifconfig ${VENET_DEV} down
erjo@8056 34 fi
erjo@8056 35 }
erjo@8056 36
erjo@8056 37 del_ip
erjo@8056 38
erjo@8056 39 exit 0