#!/bin/bash while true do PING=`ping -c 15 -q 192.168.0.2 | fgrep "transmitted," | cut -f2 -d"," | cut -f2 -d" "` if [ $PING == 0 ] then ifconfig rausb0 down && rmmod rt2570 && modprobe rt2570 && iwconfig rausb0 mode ad-hoc essid MonWlan channel 10 && ifconfig rausb0 192.168.0.1 up sleep 10 else sleep 10 fi done