#!/bin/sh

# How to use this script:
# 1) Login into the router 
# 2) wget http://wirelesspt.net/arquivos/scripts/mvwrt/mvwrt2014_update.sh
# 3) chmod +x mvwrt2014_update.sh
# 4) ./mvwrt2014_update.sh

############### DO NOT EDIT #########################

echo "";
echo "updating binary report script...";
mv /bin/report /tmp/report-old.txt
wget -q -P /bin http://wirelesspt.net/arquivos/firmware/mvwrt2014/updates/report
chmod +x /bin/report
#./ratelimit-fix.sh

echo "";
echo "Downloading txdma_install.sh...";
wget -q -P /tmp http://wirelesspt.net/arquivos/firmware/mvwrt2014/updates/txdma_install.sh
chmod +x /tmp/txdma_install.sh
. /tmp/txdma_install.sh

echo "";
echo "removing updates scripts...";
rm /tmp/mvwrt2014_update.sh
rm /tmp/txdma_install.sh

echo "";
echo "Updating configuration settings...";
wget -q -P /tmp http://wirelesspt.net/arquivos/firmware/mvwrt2014/updates/reconf.sh
chmod +x /tmp/reconf.sh
. /tmp/reconf.sh

