This: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
Draft of capture.sh script
<nowiki>#!</nowiki>/bin/sh<br><br>
<nowiki>#!</nowiki>/bin/sh<br><br>

case $1 in<br>
case $1 in<br>
e|-e)<br>
e|-e)<br>
ifconfig msh0 down<br>
ifconfig msh0 down<br>
ifconfig eth0 down<br>
ifconfig eth0 down<br>
/sbin/service NetworkManager stop<br>
/sbin/service NetworkManager stop<br>
export TRAFFIC_MASK=0x7<br>
export TRAFFIC_MASK=0x7<br>
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap<br>
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap<br>
ifconfig rtap0 up <br>
ifconfig rtap0 up <br>
<nowiki>;;</nowiki><br>
<nowiki>;;</nowiki><br>
d|-d)<br>
d|-d)<br>
ifconfig rtap0 down<br>
ifconfig rtap0 down<br>
export TRAFFIC_MASK=0x0<br>
export TRAFFIC_MASK=0x0<br>
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap<br>
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap<br>
/sbin/service NetworkManager start<br>
/sbin/service NetworkManager start<br>
ifconfig msh0 up<br>
ifconfig msh0 up<br>
ifconfig eth0 up<br>
ifconfig eth0 up<br>
<nowiki>;;</nowiki><br>
<nowiki>;;</nowiki><br>
<nowiki>*)</nowiki><br>
<nowiki>*)</nowiki><br>
echo "USAGE: sh capture.sh e|d"<br>
echo "USAGE: sh capture.sh e|d"<br>
<nowiki>;;</nowiki><br>
<nowiki>;;</nowiki><br>
esac<br>
esac<br>

Latest revision as of 16:39, 3 June 2008

Draft of capture.sh script

   #!/bin/sh

case $1 in
e|-e)
ifconfig msh0 down
ifconfig eth0 down
/sbin/service NetworkManager stop
export TRAFFIC_MASK=0x7
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap
ifconfig rtap0 up
 ;;
d|-d)
ifconfig rtap0 down
export TRAFFIC_MASK=0x0
echo $TRAFFIC_MASK > /sys/class/net/eth0/device/libertas_rtap
/sbin/service NetworkManager start
ifconfig msh0 up
ifconfig eth0 up
 ;;
*)
echo "USAGE: sh capture.sh e|d"
 ;;
esac