自己用shell+shell脚本自动修改IP信息
2012-02-24 13:07
731 查看
#!/bin/bash
#
echo 系统时间是:`date -d '-1 month' +%Y-%m-%d`
echo 查看当前系统版本:`cat /etc/issue`
echo 查看版本内核:`uname -r`
echo 当前登录用户的UID:$UID
echo 当前登录用户的名称:$LOGNAME
echo 查看服务器CPU:`cat /proc/cpuinfo | grep -c processor`
echo "########################################################################"
echo 关闭iptables
/sbin/chkconfig iptables off
/sbin/chkconfig ip6tables off
/sbin/service iptables stop
/sbin/service ip6tables stop
/sbin/service iptables status
sed -i '/SELINUX=enforcing/s/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
/usr/sbin/setenforce 0
echo 查看SELINUX运行状态:`/usr/sbin/getenforce`
echo "########################################################################"
echo 本机IP地址
ifconfig $1|sed -n 2p|awk '{ print $2 }'|awk -F : '{ print $2 }'
echo 更换IP地址
echo -n "Continue?(Y/N)"
read ANSWER
case $ANSWER in
[Yy])
echo " you input is y or Y !"
sh ip.sh
;;
[Nn])
echo " Please continue to implement "$ANSWER
;;
esac
echo "########################################################################"
#
echo 系统时间是:`date -d '-1 month' +%Y-%m-%d`
echo 查看当前系统版本:`cat /etc/issue`
echo 查看版本内核:`uname -r`
echo 当前登录用户的UID:$UID
echo 当前登录用户的名称:$LOGNAME
echo 查看服务器CPU:`cat /proc/cpuinfo | grep -c processor`
echo "########################################################################"
echo 关闭iptables
/sbin/chkconfig iptables off
/sbin/chkconfig ip6tables off
/sbin/service iptables stop
/sbin/service ip6tables stop
/sbin/service iptables status
sed -i '/SELINUX=enforcing/s/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
/usr/sbin/setenforce 0
echo 查看SELINUX运行状态:`/usr/sbin/getenforce`
echo "########################################################################"
echo 本机IP地址
ifconfig $1|sed -n 2p|awk '{ print $2 }'|awk -F : '{ print $2 }'
echo 更换IP地址
echo -n "Continue?(Y/N)"
read ANSWER
case $ANSWER in
[Yy])
echo " you input is y or Y !"
sh ip.sh
;;
[Nn])
echo " Please continue to implement "$ANSWER
;;
esac
echo "########################################################################"
相关文章推荐
- shell脚本自动修改IP信息
- shell脚本自动修改IP信息
- shell脚本自动修改IP信息
- shell脚本自动修改IP信息
- Shell脚本实现自动修改IP、主机名等功能分享
- Shell脚本实现自动检测修改最快的Ubuntu软件源
- 自动扫描局域网并且发现指定端口开放的主机ip的shell脚本
- 一个自己写的自动格式化,开机挂载,创建用户和管理ACL权限的shell脚本
- linux下shell脚本自动生成编译信息
- linux 自动ping ip的shell脚本
- shell脚本实现Linux ip的配置(增删改查)以及相关信息查看
- 自动修改ip脚本
- 用shell脚本收集查询IP信息的网站
- 写shell脚本自动生成shell脚本头注释信息
- shell脚本实现ssh自动登录-功能扩展,实现多个IP可选
- 使用iptables自动封IP的Shell脚本
- 朋友的一个问题:Linux开机如何自动运行自己编写好的shell脚本
- Shell脚本实现非法IP登陆自动报警