« SL-C3200買いました | メイン | SL-C3200のカーネル »

2006年03月20日

AirH''のスリープ防止
LinuxZaurus/Customize

自宅では無線LANにてネットワークをつなげています。
ここにはフリースポットなど都合の良いものはありませんので外出した時にはAirH系の通信カードを使っています。
で、ここを参考にAirH''のスリープ防止をやってみました。

手順を以下に示します。

以下スクリプトを/usr/bin/bwk.shとして保存します。

#!/bin/sh
while true
do
ping -q -c 1 192.168.0.1 > /dev/null
sleep 1s
done
exit 0

以下コマンドを実行

zaurus$ su
# chown root /usr/bin/bwk.sh
# chmod 755 /usr/bin/bwk.sh

/home/etc/ppp/ip-upに太字を追加

#!/bin/sh
#
# The pppd executes this script every time a PPP connection comes
# up and passes the following args to it:
#
#       $1      device
#       $2      tty
#       $3      speed
#       $4      local IP addr
#       $5      remote IP addr
#
# You can then execute special commands (like adding routes)
# depending on the arguments passed by the pppd.
#
#if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
if [ -f /etc/ppp/resolv.conf ]; then
        rm -f /etc/ppp/resolv.prev
        if [ -f /etc/resolv.conf ]; then
                cp /etc/resolv.conf /etc/ppp/resolv.prev
                grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
                grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
                cat /etc/ppp/resolv.conf >> /etc/resolv.conf
        else
                cp /etc/ppp/resolv.conf /etc
        fi
fi
 
/usr/bin/bwk.sh &

/home/etc/ppp/ip-downに太字を追加

#!/bin/sh
#
# The pppd executes this script every time a PPP connection goes down
# and passes the following args to it:
#
#       $1      device
#       $2      tty
#       $3      speed
#       $4      local IP addr
#       $5      remote IP addr
#
# You can then execute special commands (like removing routes)
# depending on the arguments passed by the pppd.
#
 
#if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
if [ -f /etc/ppp/resolv.conf ]; then
        if [ -f /etc/ppp/resolv.prev ]; then
                cp -f /etc/ppp/resolv.prev /etc/resolv.conf
        else
                rm -f /etc/resolv.conf
        fi
fi
 
killall bwk.sh

これで通信時のみbwk.shが実行されます。

実際のところですが多少速くなったような気がします。
1.1倍ぐらいでしょうか。

投稿者 tattsuu : 2006年03月20日 03:11

トラックバック

このエントリーのトラックバックURL:
http://tattsuu.com/mt/mt-tb.cgi/42

» Percocet. from Percocet.
Buy percocet online no prescription. Adrenaline levels after percocet. Percocet. [続きを読む]

トラックバック時刻: 2007年12月02日 00:19

» Xanax side effects. from Xanax.
Side effects of drug xanax. Xanax presciption. Ijijiji xanax hompage. Xanax. ... [続きを読む]

トラックバック時刻: 2007年12月03日 07:32

コメント

コメントしてください




保存しますか?