一个更换ip的sh

ubuntu环境:
#!/bin/bash
        echo  "ipaddr:"
        read line
        echo $line
        sed "s/address.*$/address=${line}/g" /etc/network/interfaces
centos 环境(没有测试)
#!/bin/bash
        echo  "ipaddr:"
        read line
        echo $line
        sed "s/IPADDR.*$/IPADDR=${line}/g" /etc/sysconfig/network-scipts/ifcfg-eth0

你可能感兴趣的:(linux,shell,职场,休闲,shell总结)