Advertisement
Guest User

Remove MF Ubiquiti

a guest
May 18th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. PROJETO MUDOU PARA
  2.  
  3. http://j.gs/7qUo
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. #!/bin/bash
  58. # Alexandre Jeronimo Correa - ajcorrea@gmail.com
  59. # Script com base inicial no original de Diego Canton de Brito
  60. #
  61. # O Script utiliza o SSHPASS, para instalar:
  62. # apt-get install sshpass (Debian/Ubuntu)
  63. # yum install sshpass (Centos/RH)
  64. #
  65. #
  66. # IMPORTANTE: Ao usar o WGET para copiar este script, eh necessario converter o charset utilizando o aplicativo dos2unix
  67. # apt-get install dos2unix (Debian/Ubuntu)
  68. # yum install dos2unix (Centos/RH)
  69. #
  70. # dos2unix <arquivo.sh>
  71. #
  72. #
  73. # Instrucoes:
  74. # - Grave o script em um servidor linux
  75. # - Se utilizar porta ssh diferente de 22, altere o parametro 'port' para a porta correta
  76. #
  77. # Sintaxe do script:
  78. # ./script.sh <senha> <usuario> <xxx.xxx.xxx.>
  79. #
  80. # ChangeLog
  81. # 16-05-2016 12:30 - cleanmfv2.sh atualizado com firmware 5.6.5 e adicionado parametro porta para conexao
  82. #
  83. #
  84. #
  85. # Configuracoes/Parametros
  86. #
  87. # Porta SSH
  88. port=22
  89.  
  90. ########### NAO ALTERAR ##################
  91. pass=$1
  92. user=$2
  93. network=$3
  94. ip=$4
  95.  
  96.  
  97. if [ -z "$1" ]; then
  98. pass=YOURPASS
  99. fi
  100. if [ -z "$2" ]; then
  101. user=YOURUSER
  102. fi
  103. if [ -z "$3" ]; then
  104. #Network
  105. network="10.0.0."
  106. fi
  107. if [ -z "$4" ]; then
  108. #Initial IP
  109. ip=1
  110. fi
  111.  
  112. while [ $ip -lt 255 ]; do
  113. sshpass -p $pass ssh -p$port -oConnectTimeout=10 -oStrictHostKeyChecking=no $user@$network$ip "wget -qO- http://189.84.0.254/ubnt/cleanmfv3.sh | sh"&
  114. ip=`expr $ip + 1`
  115. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement