/etc/vz/dists/scripts/slackware-add_ip.sh is in vzctl 4.9.4-5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87  | #!/bin/bash
#  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# Adds IP address in a container running Slackware.
# Slackware does not support IP aliases so multiple IP addresses not allowed
VENET_DEV=venet0
IFCFG_DIR=/etc/rc.d
IFCFG=${IFCFG_DIR}/rc.inet1.conf
HOSTFILE=/etc/hosts
function fix_rcinet1()
{
	local file="${IFCFG_DIR}/rc.inet1"
	[ -f "${file}" ] || return 0
	cp -fp ${file} ${file}.$$ || error "Can't copy file ${file}" ${VZ_FS_NO_DISK_SPACE}
	sed -e 's/eth/venet/g' -e 's/^[\ \t]*\/sbin\/route add default gw .*/\t\/sbin\/route add -net '${FAKEGATEWAYNET}'\/24 dev venet0; \/sbin\/route add default gw \${GATEWAY} dev venet0/' < ${file} > ${file}.$$ && mv -f ${file}.$$ ${file}
	rm -f ${file}.$$ >/dev/null 2>&1
}
function setup_network()
{
	mkdir -p ${IFCFG_DIR}
	# Set up /etc/hosts
	if [ ! -f ${HOSTFILE} ]; then
		echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE
	fi
	fix_rcinet1
}
function create_config()
{
	local ip=${1}
	local netmask=${2}
	echo "# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
IPADDR[0]=\"${ip}\"
NETMASK[0]=\"${netmask}\"
# Default gateway IP address:
GATEWAY=\"${FAKEGATEWAY}\"
" > ${IFCFG}
}
function add_ip()
{
	# In case we are starting CT
	if [ "x${VE_STATE}" = "xstarting" ]; then
		setup_network
	fi
	local ipm
	for ipm in ${IP_ADDR}; do
		ip_conv $ipm
		if [ "${IPDELALL}" != "yes" ]; then
			if grep -qw "${_IP}" ${IFCFG} 2>/dev/null; then
				break
			fi
		fi
		${IFCFG_DIR}/rc.inet1 stop >/dev/null 2>&1
		create_config ${_IP} ${_NETMASK}
		${IFCFG_DIR}/rc.inet1 start >/dev/null 2>&1
		break
	done
}
add_ip
exit 0
# end of script
 |