在使用动态vps服务器的时候发现一枚已经写好的自动配置拨号的shell脚本,分享一下,免去手动配置的烦恼,代码如下
#! /bin/shPATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/binLog=/var/log/pppoe.logsed -i '/^GATEWAY/d' /etc/sysconfig/network-scripts/ifcfg-eth0sed -i '/^DNS1/d' /etc/sysconfig/network-scripts/ifcfg-eth0sed -i '/^DNS2/d' /etc/sysconfig/network-scripts/ifcfg-eth0echo "del ifcfg-eth0 Gateway ...... Success" > $Logecho "del ifcfg-eth0 DNS1 ...... Success" >> $Logecho "del ifcfg-eth0 DNS2 ...... Success" >> $Logread -p "请输入ADSL帐号:" idread -p "请输入ADSL密码:" pssed -i 's/root/'$id'/g' /etc/ppp/chap-secretssed -i 's/12345/'$ps'/g' /etc/ppp/chap-secretsecho "MOdify chap-secrets ...... Success" >>$Logsed -i 's/root/'$id'/g' /etc/ppp/pap-secretssed -i 's/12345/'$ps'/g' /etc/ppp/pap-secretsecho "Modify pap-secrets ......Success" >>$Logsed -i 's/root/'$id'/g' /etc/sysconfig/network-scripts/ifcfg-ppp0echo "Modify ifcfg-ppp0 ......Success" >>$Logecho nameserver 114.114.114.114 >> /etc/resolv.confecho nameserver 8.8.8.8 >> /etc/resolv.confsystemctl restart network.service cat $Logexit
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持VEVB武林网。
新闻热点
疑难解答
图片精选