sudo vi /sbin/ipconfig
---------
待改进
[list]
[*]支持eth0 与 wlan0
[*]支持dnsmasq
[/list]
#! /bin/bash
for word in `ifconfig eth0 | grep "inet addr" | sed 's/ inet addr/addr/g'`; do echo $word | sed 's/:/\t/g'; done
route -n | awk '/UG/ {printf "gateway %-21s %s\n", $2,$8}' ;
grep nameserver /etc/resolv.conf ;
sudo chmod +x /sbin/ipconfig
ipconfig
---------
待改进
[list]
[*]支持eth0 与 wlan0
[*]支持dnsmasq
[/list]
本文介绍了如何通过bash脚本优化ipconfig命令,支持多个网络适配器(如eth0与wlan0),并集成DNS配置功能。包括改进的命令实现、关键操作步骤及待解决的挑战。
2804

被折叠的 条评论
为什么被折叠?



