proxy_centos/bin/ifcfg-eth0-template.sh

16 lines
345 B
Bash
Executable file

#!/usr/bin/env bash
# this script will build a network config file on a CentOS 7 system.
# it is expected to already have a /etc/sysconfig/network-scripts/ifcfg-eth0 file created
# this is additional ip creation for 1 nic.
IP=$1
ID=$2
cat << EOF
BOOTPROTO=static
DEVICE=eth0:$ID
IPADDR=$IP
NETMASK=255.255.255.255
BROADCAST=$IP
ONBOOT=yes
EOF