本文主要是介绍新路程------rtl8188的配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
runwpa文件
#!/bin/bash
if [ "`which iwconfig`" = "" ] ; then 如果运行which iwconfig的结果为空则输出下面的提示
echo "WARNING:Wireless tool not exist!"
echo " Please install it!"
exit
else
if [ `uname -r | cut -d. -f2` -eq 4 ]; then 运行uname -r,以.为分隔符取第二个参数如果等于4则运行if
wpa_supplicant -D ipw -c wpa1.conf -i wlan0
else
if [ `iwconfig -v |awk '{print $4}' | head -n 1` -lt 18 ] ; then
wpa_supplicant -D ipw -c wpa1.conf -i wlan0
else
wpa_supplicant -D wext -c wpa1.conf -i wlan0
fi
fi
fi
关于wpa_supplicant 无线配置
options:
-b = optional bridge interface name
-B = run daemon in the background
-c = Configuration file
-C = ctrl_interface parameter (only used if -c is not)
-i = interface name
-d = increase debugging verbosity (-dd even more)
-D = driver name (can be multiple drivers: nl80211,wext)
-g = global ctrl_interface
-K = include keys (passwords, etc.) in debug output
-t = include timestamp in debug messages
-h = show this help text
-L = show license (GPL and BSD)
-o = override driver parameter for new interfaces
-O = override ctrl_interface parameter for new interfaces
-p = driver parameters
-P = PID file
-q = decrease debugging verbosity (-qq even less)
-v = show version
-W = wait for a control interface monitor before starting
-N = start describing new interface
wlan0dhcp文件:
#!/bin/bash
var0=`ps aux|awk '/dhclient wlan0/'|awk '$11!="awk"{print $2}'` 列出dhclient wlan0这个进程的第二个参数
#/usr # ps aux|awk '/dhclient wlan0/'|awk '$11!="awk"{print $2}'
#root
#/usr # ps aux|awk '/dhclient wlan0/'
# 1132 root 0:00 awk /dhclient wlan0
kill $var0 从这里看是抓进程号来杀死进程,应该是"awk"{print $1}才对啊
cp ifcfg-wlan0 /etc/sysconfig/network-scripts/
dhclient wlan0 如果是用DHCP获取IP的,那么用dhclient或dhcpcd获取ip
var1=`ifconfig wlan0 |awk '/inet/{print $2}'|awk -F: '{print $2}'`抓带inet的第二个参数以及以:为分隔符的第二个参数
rm -f /etc/sysconfig/network-scripts/ifcfg-wlan0
echo "get ip: $var1"
这篇关于新路程------rtl8188的配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!