📄 zzz-wireless
字号:
#!/bin/sh## /etc/network/if-pre-up.d/zzz-wireless# by Stefan Tomanek (stefan@pico.ruhr.de)IWCONFIG=/sbin/iwconfigIFCONFIG=/sbin/ifconfigGREP=/bin/grepLOGGER=/usr/bin/loggerSLEEP=/bin/sleep# How long do we wait for association?RETRIES=15SLEEPTIME=1# Only sleep if we use DHCP (add others methods seperated by spaces)ONLY_FOR="static dhcp"if [ -z "$IF_WIRELESS_TYPE" ] && echo "$ONLY_FOR" | grep -q "$METHOD" ; then $IFCONFIG $IFACE up $LOGGER Checking for WLAN association... while ( [ $RETRIES -gt 0 ] && ($IWCONFIG "$IFACE" | $GREP -q "Access Point: Not-Associated") ); do $LOGGER No association yet, $RETRIES retries until timeout RETRIES=$(($RETRIES-1)) $SLEEP $SLEEPTIME done if [ $RETRIES -eq 0 ]; then $LOGGER Timeout waiting for association, continuing anyway... else $LOGGER Found association! fifi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -