Advertisement
ajcorrea

[ubnt] Remove MF local

May 16th, 2016
1,686,435
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. # Alexandre Jeronimo Correa - ajcorrea@gmail.com
  3. # Script para AirOS Ubiquiti
  4. # Remove o worm MF e atualiza para a ultima versao do AirOS disponivel oficial
  5. #
  6. ##### NAO ALTERAR ####
  7. /bin/sed -ir '/mcad/ c ' /etc/inittab
  8. /bin/sed -ir '/mcuser/ c ' /etc/passwd
  9. /bin/rm -rf /etc/persistent/https
  10. /bin/rm -rf /etc/persistent/mcuser
  11. /bin/rm -rf /etc/persistent/mf.tar
  12. /bin/rm -rf /etc/persistent/.mf
  13. /bin/rm -rf /etc/persistent/rc.poststart
  14. /bin/rm -rf /etc/persistent/rc.prestart
  15. /bin/kill -HUP `/bin/pidof init`
  16. /bin/kill -9 `/bin/pidof mcad`
  17. /bin/kill -9 `/bin/pidof init`
  18. /bin/kill -9 `/bin/pidof search`
  19. /bin/kill -9 `/bin/pidof mother`
  20. /bin/kill -9 `/bin/pidof sleep`
  21. /bin/cfgmtd -w -p /etc/
  22.  
  23. fullver=`cat /etc/version`
  24. if [ "$fullver" == "XM.v5.6.5" ]; then
  25. echo "Atualizado... Done"
  26. exit
  27. fi
  28. if [ "$fullver" == "XW.v5.6.5" ]; then
  29. echo "Atualizado... Done"
  30. exit
  31. fi
  32.  
  33. versao=`cat /etc/version | cut -d'.' -f1`
  34. cd /tmp
  35. rm -rf /tmp/X*.bin
  36. if [ "$versao" == "XM" ]; then
  37. URL='http://dl.ubnt.com/firmwares/XN-fw/v5.6.5/XM.v5.6.5.29033.160515.2119.bin'
  38. # URL='http://dl.ubnt.com/firmwares/XN-fw/v5.6.4/XM.v5.6.4.28924.160331.1253.bin'
  39. wget -c $URL
  40. ubntbox fwupdate.real -m /tmp/XM.v5.6.5.29033.160515.2119.bin
  41. else
  42. URL='http://dl.ubnt.com/firmwares/XW-fw/v5.6.5/XW.v5.6.5.29033.160515.2108.bin'
  43. # URL='http://dl.ubnt.com/firmwares/XW-fw/v5.6.4/XW.v5.6.4.28924.160331.1238.bin'
  44. wget -c $URL
  45. ubntbox fwupdate.real -m /tmp/XW.v5.6.5.29033.160515.2108.bin
  46. fi
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement