centos6.6 脚本

#!/bin/bash
#static
cd /etc/sysconfig/network-scripts
sed -i 's/ONBOOT=no/ONBOOT=yes/g' ifcfg-eth0
sed -i 's/dhcp/static/g' ifcfg-eth0
echo IPADDR=192.168.1.100 >> ifcfg-eth0
echo NETMASK=255.255.255.0 >> ifcfg-eth0
echo GATEWAY=192.168.1.1 >> ifcfg-eth0
echo DNS1=192.168.1.1 >> ifcfg-eth0
service network restart


1、删除邮件
cd  /var/spool/mail
echo "">root

你可能感兴趣的:(centos6)