|
- #!/bin/sh
- day=$(date +"%Y%m%d")
- FULLFLASH_FILE="/tmp/newifi-d2-"$day"-fullflash.bin"
- OPT_PATH="/etc/hotplug.d/block/30_mount-opt"
- UMOUNT_FILE="/usr/sbin/xc-usb-umount"
- GRO_FILE="/etc/rc.local"
- set_wifi_and_led(){
- uci batch <<EOF
- set wireless.ra0.channel='11'
- set wireless.ra0.noscan='1'
- set wireless.rai0.channel='149'
- set wireless.rai0.htmode='VHT80'
- commit wireless
- delete system.internet_led
- commit system
- EOF
- }
- gro_off(){
-
- [ -n $GRO_FILE ] && sed -i '$i\echo 0 > /proc/napi_gro_en' $GRO_FILE
- [ -n $GRO_FILE ] && sed -i '$i\/usr/sbin/factory-for-telnet.sh &' $GRO_FILE
-
- /etc/init.d/telnet disable
- }
- make_fullflash(){
- mtd=$(cat /proc/mtd | grep "fullflash" | awk -F ":" '{print $1}')
- if [ -n "$mtd" ];then
- touch $FULLFLASH_FILE
- [ -f $FULLFLASH_FILE ] && dd if=/dev/$mtd of=/$FULLFLASH_FILE conv=fdatasync
- fi
- }
- [ -f $OPT_PATH ] && rm -f $OPT_PATH
- [ -f $UMOUNT_FILE ] && rm -f $UMOUNT_FILE
- set_wifi_and_led
- gro_off
- make_fullflash
复制代码
|
|