#!/bin/bash
#############
#Date 2022/6/8
#mail it-arch
#############
echo "##########################################"
echo "Auto Install monitor-linux.             ##"
echo "Press Ctrl + C to cancel                ##"
echo "Any key to continue                     ##"
echo "##########################################"
read -n 1
service NetworkManager stop
read -p "Please input ip address:" IP
cd /etc/sysconfig/network-scripts/
cp ifcfg-lo ifcfg-eth1
cat > ifcfg-eth1 << EOF
DEVICE=eth1
IPADDR=$IP
NETMASK=255.255.255.0
ONBOOT=yes
NAME=eth1
EOF
/etc/init.d/network restart
ip=`ifconfig | grep "inet addr" |grep -v 127.0.0.1|awk '{print $2}'|cut -d: -f2`
echo  "network configure is success ip address is $ip "
