Advertisement
smoke_ve

etc

Oct 24th, 2011
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. falta mas pronto se edita .
  2.  
  3. # ls *sh
  4. wlanapp.sh pppoe.sh fixedip.sh ddns.sh alias.sh
  5. wlan.sh ntp.sh firewall.sh connect.sh ack.sh
  6. watchdog.sh mesh.sh domain.sh check.sh
  7. sh init.sh disconnect.sh cbu.sh
  8. reload.sh ifc.sh dhcpd.sh bridge.sh
  9. pptp.sh flash dhcpc.sh ash
  10. # cat domain.sh
  11. #!/bin/sh
  12.  
  13. # Modificado em 04/06/2011 por Guilew - v6.1
  14. # Colaboracao: Alexander Eduardo Belck
  15.  
  16. ##Arquivo para colocar os apelidos de ip
  17.  
  18. ##Normal
  19. WAN=eth1
  20. ##G120
  21. #WAN=eth0
  22. LAN=br0
  23. eval `flash get WAN_DHCP`
  24. eval `flash get OP_MODE`
  25.  
  26. if [ "$OP_MODE" = '2' ] || [ "$OP_MODE" = '4' ];then
  27. OP_MODE=2
  28. elif [ "$OP_MODE" = '0' ] || [ "$OP_MODE" = '3' ];then
  29. OP_MODE=0
  30. fi
  31.  
  32. if [ "$OP_MODE" = '2' ];then
  33. WAN=wlan0
  34. fi
  35.  
  36. if [ $WAN_DHCP = 3 ] || [ $WAN_DHCP = 4 ]; then
  37. WAN=ppp0
  38. fi
  39.  
  40. TOOL=flash
  41. GETMIB="$TOOL get"
  42.  
  43. broad ()
  44. {
  45. rm -rf /tmp/broadcast
  46. IP=$1
  47. MASK=$2
  48. num2=1
  49. while [ $num2 -le 4 ];
  50. do
  51. TMP_IP=`echo $IP | cut -d "." -f $num2`
  52. TMP_MASK=`echo $MASK | cut -d "." -f $num2`
  53. let TMP_NET=$TMP_IP\&$TMP_MASK
  54. let TMP_SIZE=255-$TMP_MASK
  55. let BROAD=$TMP_NET+$TMP_SIZE
  56. if [ $BROAD -gt 255 ]; then
  57. BROAD = 255
  58. fi
  59. echo -n "${BROAD}" >> /tmp/broadcast
  60. num2=`expr $num2 + 1`
  61. if [ $num2 -lt 5 ];then
  62. echo -n "." >> /tmp/broadcast
  63. fi
  64. done
  65. return
  66. }
  67.  
  68. ## Alias Wan
  69. num=1
  70. while [ $num -le 5 ];
  71. do
  72. IP=`$GETMIB WA${num}`
  73. end_ip=`echo $IP | cut -f2 -d=`
  74. if [ $end_ip != "0.0.0.0" ];then
  75. M=`$GETMIB WM${num}`
  76. mask=`echo $M | cut -f2 -d=`
  77. broad $end_ip $mask
  78. broadcast=`cat /tmp/broadcast`
  79. ifconfig ${WAN}:$num $end_ip netmask $mask broadcast $broadcast
  80. else
  81. ifconfig ${WAN}:$num down 2> /dev/null > /dev/null
  82. fi
  83. num=`expr $num + 1`
  84. done
  85.  
  86. ## Alias LAN
  87. num=1
  88. while [ $num -le 5 ];
  89. do
  90. IP=`$GETMIB LA${num}`
  91. end_ip=`echo $IP | cut -f2 -d=`
  92. if [ $end_ip != "0.0.0.0" ];then
  93. M=`$GETMIB LM${num}`
  94. mask=`echo $M | cut -f2 -d=`
  95. broad $end_ip $mask
  96. broadcast=`cat /tmp/broadcast`
  97. ifconfig ${LAN}:$num $end_ip netmask $mask broadcast $broadcast
  98. else
  99. ifconfig ${LAN}:$num down 2> /dev/null > /dev/null
  100. fi
  101. num=`expr $num + 1`
  102. done
  103.  
  104. # cd home/j/c/d
  105.  
  106. resolv.conf passwd host.conf
  107. dropbear_rsa_host_key olsrd.conf group
  108. terminfo nsswitch.conf ethers
  109. shells l7-protocols cbu.conf
  110. services inittab toptop
  111. script.sh init.sh udhcpc
  112. protocols init.d crontabs
  113. passwd.ori hosts
  114. #cd toptop
  115. #
  116. #ls
  117. confi.zip prog.zip initcrack.zip
  118. # cd ..
  119. cd todtop
  120. ip-up true peers chap-secrets pap-secrets
  121.  
  122.  
  123. # cat ip-up
  124. #!/bin/sh
  125. # Modificado em 12/06/2010 por Guilew - v6.1
  126. #
  127. # $1 Interface name ppp0
  128. # $2 The tty ttyS1
  129. # $3 The link speed 38400
  130. # $4 Local IP number 12.34.56.78
  131. # $5 Peer IP number 12.34.56.99
  132. # $6 Optional ``ipparam'' value foo
  133.  
  134. # The environment is cleared before executing this script
  135. # so the path must be reset
  136. PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
  137. export PATH
  138.  
  139. # These variables are for the use of the scripts run by run-parts
  140. PPP_IFACE="$1"
  141. PPP_TTY="$2"
  142. PPP_SPEED="$3"
  143. PPP_LOCAL="$4"
  144. PPP_REMOTE="$5"
  145. PPP_IPPARAM="$6"
  146. #
  147.  
  148. # cat pass
  149.  
  150. root:$1$$ovDuEVgI1xAqOA7dkmAg1:0:0:root:/:/bin/sh
  151. nobody:x:99:99:Nobody:/:
  152.  
  153. # cd ..
  154. # ls *conf
  155. resolv.conf olsrd.conf nsswitch.conf host.conf cbu.conf
  156.  
  157. # cat cbu.conf
  158. #### ARQUIVO DE CONTROLE DE BANDA - AP ROUTER NG ####
  159.  
  160. ### ESTE ARQUIVO TRABALHA EM CONJUNTO COM AS CONFIGURACOES VIA WEB ###
  161. ### LINHAS COMECANDO COM "#" SAO COMENTARIOS ###
  162.  
  163. ### !!! ATENCAO !!! ###
  164. ## APOS EDITAR E SALVAR ESTE ARQUIVO VIA TERMINAL SSH, EXECUTE OS 2 COMANDOS ABAIXO
  165. ##NESSA ORDEM:
  166. ## cbu.sh
  167. ## firewall.sh
  168. ## E NAO ESQUECA DE SALVAR A ESTRUTURA DO DIRETORIO COM O COMANDO:
  169. ## salvar
  170.  
  171. ### CONTROLE DE BANDA POR IP ###
  172. ## NAO ESQUECER DE HABILITAR O CONTROLE DE BANDA POR IP VIA INTERFACE WEB
  173. ## Coloque abaixo os enderecos IPs dos clientes a serem controlados
  174. ## um por linha, seguindo o exemplo de formato abaixo:
  175. ##
  176. ## ID DO GRUPO,ENDERECO IP,RATE DE SAIDA LAN,RATE DE SAIDA WAN,COMENTARIO
  177. ##QUALQUER
  178. ##
  179. ## O formato acima segue o mesmo principio do controle de banda via WEB
  180. ## EX:
  181. #0,192.168.2.3,256,256,Joao da Silva
  182. #0,192.168.2.0/24,128,128,Toda a rede 192.168.2.xxx
  183.  
  184. ### CONTROLE DE BANDA POR MAC ###
  185. ## NAO ESQUECER DE HABILITAR O CONTROLE DE BANDA POR MAC VIA INTERFACE WEB
  186. ## Coloque abaixo os enderecos MACs dos clientes a serem controlados
  187. ## um por linha, seguindo o exemplo de formato abaixo:
  188. ##
  189. ##ID DO GRUPO,ENDERECO MAC,RATE DE SAIDA LAN,RATE DE SAIDA WAN,COMENTARIO
  190. ##QUALQUER
  191. ##
  192. ##
  193. #0,00:4f:62:04:54:12,256,256,Joao da Silva
  194. #0,00:4f:62:04:54:13,128,128,Maria
  195.  
  196.  
  197.  
  198. # ls
  199. config.dat upload.asp password.asp ethers.asp
  200. wlwpa.asp title.htm opmode.asp dmz.asp
  201. wlwep.asp tcpipwan.asp ntp.asp discover.asp
  202. wlwdstbl.asp tcpiplan.asp mtmcode.js dhcptbl.asp
  203. wlwdsenp.asp syslog.asp menu-images ddns.asp
  204. wlwds.asp syscmd.asp menu_empty.html css
  205. wlsurvey.asp status.asp menu.asp common.js
  206. wlstatbl.asp stats.asp macfilter.asp code.asp
  207. wlbasic.asp sinal.asp logout.asp cbu.asp
  208. wladvanced.asp script.asp licenca.asp bandlimit.asp
  209. wlactrl.asp saveconf.asp ipfilter.asp aplicar.asp
  210. wizard.asp reboot.asp ipalias.asp
  211. webport.asp portfw.asp home.asp
  212. watchdog.asp portfilter.asp graphics
  213. # cat password.asp
  214. <html>
  215. <head>
  216. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  217. <link rel="stylesheet" href="css/aprouter.css" type="text/css">
  218. <title>Password configuration</title>
  219. <% language=javascript %>
  220. <SCRIPT>
  221.  
  222. function includeSpace(str)
  223. {
  224. for (var i=0; i<str.length; i++) {
  225. if ( str.charAt(i) == ' ' ) {
  226. return true;
  227. }
  228. }
  229. return false;
  230. }
  231.  
  232. function saveChanges()
  233. {
  234. if ( document.password.username.value.length == 0 ) {
  235. if ( !confirm('User account is empty.\nDo you want to disable the password protection?') ) {
  236. document.password.username.focus();
  237. return false;
  238. }
  239. else
  240. return true;
  241. }
  242.  
  243. if ( document.password.newpass.value != document.password.confpass.value) {
  244. alert('Password is not matched. Please type the same password between \'new\' and \'confirmed\' box.');
  245. document.password.newpass.focus();
  246. return false;
  247. }
  248.  
  249. if ( document.password.username.value.length > 0 &&
  250. document.password.newpass.value.length == 0 ) {
  251. alert('Password cannot be empty. Please try it again.');
  252. document.password.newpass.focus();
  253. return false;
  254. }
  255.  
  256. if ( includeSpace(document.password.username.value)) {
  257. alert('Cannot accept space character in user name. Please try it again.');
  258. document.password.username.focus();
  259. return false;
  260. }
  261.  
  262. if ( includeSpace(document.password.newpass.value)) {
  263. alert('Cannot accept space character in password. Please try it again.');
  264. document.password.newpass.focus();
  265. return false;
  266. }
  267.  
  268. return true;
  269. }
  270.  
  271. </SCRIPT>
  272. </head>
  273.  
  274. <BODY>
  275. <font class="texto_titulo">Configura&ccedil;&atilde;o de Senha</font><br>
  276. Esta p&aacute;gina &eacute; usada para configurar o usu&aacute;rio e senha que
  277. ter&aacute; acesso ao<br>
  278. gerenciamento do AP. Se deixar esses campos em branco a prote&ccedil;&atilde;o
  279. ficara<br>
  280. desabilitada.
  281. <hr size=1 noshade align=top>
  282. <form action=/goform/formPasswordSetup method=POST name="password">
  283. <table border="0" cellspacing="4" width="500">
  284. <tr>
  285. <td width="20%"><strong>Nome
  286. de Usu&aacute;rio:</strong></td>
  287. <td width="50%"><input type="text" name="username" size="20" maxlength="30"></td>
  288. </tr>
  289. <tr>
  290. <td width="20%"><strong>Nova
  291. Senha:</strong></td>
  292. <td width="50%"><input type="password" name="newpass" size="20" maxlength="30"></td>
  293. </tr>
  294. <tr>
  295. <td width="20%"><strong>Confirmar
  296. Senha:</strong></td>
  297. <td width="50%"><input type="password" name="confpass" size="20" maxlength="30"></td>
  298. </tr>
  299. </table>
  300. <input type="hidden" value="/status.asp" name="submit-url">
  301. <input type="submit" value=" Salvar " name="save" onClick="return saveChanges()">&nbsp;&nbsp;
  302. <input type="reset" value="Restaurar" name="reset">
  303. </form>
  304. </body>
  305. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement