Mi ha fatto abbastanza penare, ma ho sistemato. Ecco la soluzione:
1. creare gli script e renderli eseguibili:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=93
start () {
if test "X`lsusb |grep 140c`" == "X"; then
usb_modeswitch &>/dev/null
sleep 6
fi
ifup wan &>/dev/null
sleep 10
}
stop() {
ifdown wan &>/dev/null
killall pppd
}
#!/usr/bin/webif-page
<? . /usr/lib/webif/webif.sh
header "Info" "System" "@TR<< 3g is up! >>"
/etc/init.d/wan restart
?>
cat <<end
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://192.168.1.1/cgi-bin/webif/info.sh">
</head>
</html>
end
<?
footer
?>
#!/usr/bin/webif-page
<? . /usr/lib/webif/webif.sh
header "Info" "System" "@TR<< 3g is down >>"
/etc/init.d/wan stop
?>
cat <<end
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://192.168.1.1/cgi-bin/webif/info.sh">
</head>
</html>
end
<?
footer
?>
2. aggiungere i link alla pagina /www/cgi-bin/webif/info.sh
...
...
...
<br/>
<a href="http://192.168.1.1/cgi-bin/webif/3g-up.sh">up</a>
<a href="http://192.168.1.1/cgi-bin/webif/3g-down.sh">down</a>
EOF
footer
?>
et voil?!
dimenticavo, ho provato a creare un unico script utilizzando il metodo post dell'html, ma senza successo. se qualcuno ha qualche dritta.
nello script /etc/init.d/wan con il grep faccio un controllo se usb_modeswitch ha gi? fatto il suo lavoro...
forse l'ho gi? chiesto su questo forum, ma qualcuno mi indica come gestire la luminosit? del led usb sulla mio fonera 2202 tramite i controlli gpio?