Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- falta mas pronto se edita .
- # ls *sh
- wlanapp.sh pppoe.sh fixedip.sh ddns.sh alias.sh
- wlan.sh ntp.sh firewall.sh connect.sh ack.sh
- watchdog.sh mesh.sh domain.sh check.sh
- sh init.sh disconnect.sh cbu.sh
- reload.sh ifc.sh dhcpd.sh bridge.sh
- pptp.sh flash dhcpc.sh ash
- # cat domain.sh
- #!/bin/sh
- # Modificado em 04/06/2011 por Guilew - v6.1
- # Colaboracao: Alexander Eduardo Belck
- ##Arquivo para colocar os apelidos de ip
- ##Normal
- WAN=eth1
- ##G120
- #WAN=eth0
- LAN=br0
- eval `flash get WAN_DHCP`
- eval `flash get OP_MODE`
- if [ "$OP_MODE" = '2' ] || [ "$OP_MODE" = '4' ];then
- OP_MODE=2
- elif [ "$OP_MODE" = '0' ] || [ "$OP_MODE" = '3' ];then
- OP_MODE=0
- fi
- if [ "$OP_MODE" = '2' ];then
- WAN=wlan0
- fi
- if [ $WAN_DHCP = 3 ] || [ $WAN_DHCP = 4 ]; then
- WAN=ppp0
- fi
- TOOL=flash
- GETMIB="$TOOL get"
- broad ()
- {
- rm -rf /tmp/broadcast
- IP=$1
- MASK=$2
- num2=1
- while [ $num2 -le 4 ];
- do
- TMP_IP=`echo $IP | cut -d "." -f $num2`
- TMP_MASK=`echo $MASK | cut -d "." -f $num2`
- let TMP_NET=$TMP_IP\&$TMP_MASK
- let TMP_SIZE=255-$TMP_MASK
- let BROAD=$TMP_NET+$TMP_SIZE
- if [ $BROAD -gt 255 ]; then
- BROAD = 255
- fi
- echo -n "${BROAD}" >> /tmp/broadcast
- num2=`expr $num2 + 1`
- if [ $num2 -lt 5 ];then
- echo -n "." >> /tmp/broadcast
- fi
- done
- return
- }
- ## Alias Wan
- num=1
- while [ $num -le 5 ];
- do
- IP=`$GETMIB WA${num}`
- end_ip=`echo $IP | cut -f2 -d=`
- if [ $end_ip != "0.0.0.0" ];then
- M=`$GETMIB WM${num}`
- mask=`echo $M | cut -f2 -d=`
- broad $end_ip $mask
- broadcast=`cat /tmp/broadcast`
- ifconfig ${WAN}:$num $end_ip netmask $mask broadcast $broadcast
- else
- ifconfig ${WAN}:$num down 2> /dev/null > /dev/null
- fi
- num=`expr $num + 1`
- done
- ## Alias LAN
- num=1
- while [ $num -le 5 ];
- do
- IP=`$GETMIB LA${num}`
- end_ip=`echo $IP | cut -f2 -d=`
- if [ $end_ip != "0.0.0.0" ];then
- M=`$GETMIB LM${num}`
- mask=`echo $M | cut -f2 -d=`
- broad $end_ip $mask
- broadcast=`cat /tmp/broadcast`
- ifconfig ${LAN}:$num $end_ip netmask $mask broadcast $broadcast
- else
- ifconfig ${LAN}:$num down 2> /dev/null > /dev/null
- fi
- num=`expr $num + 1`
- done
- # cd home/j/c/d
- resolv.conf passwd host.conf
- dropbear_rsa_host_key olsrd.conf group
- terminfo nsswitch.conf ethers
- shells l7-protocols cbu.conf
- services inittab toptop
- script.sh init.sh udhcpc
- protocols init.d crontabs
- passwd.ori hosts
- #cd toptop
- #
- #ls
- confi.zip prog.zip initcrack.zip
- # cd ..
- cd todtop
- ip-up true peers chap-secrets pap-secrets
- # cat ip-up
- #!/bin/sh
- # Modificado em 12/06/2010 por Guilew - v6.1
- #
- # $1 Interface name ppp0
- # $2 The tty ttyS1
- # $3 The link speed 38400
- # $4 Local IP number 12.34.56.78
- # $5 Peer IP number 12.34.56.99
- # $6 Optional ``ipparam'' value foo
- # The environment is cleared before executing this script
- # so the path must be reset
- PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
- export PATH
- # These variables are for the use of the scripts run by run-parts
- PPP_IFACE="$1"
- PPP_TTY="$2"
- PPP_SPEED="$3"
- PPP_LOCAL="$4"
- PPP_REMOTE="$5"
- PPP_IPPARAM="$6"
- #
- # cat pass
- root:$1$$ovDuEVgI1xAqOA7dkmAg1:0:0:root:/:/bin/sh
- nobody:x:99:99:Nobody:/:
- # cd ..
- # ls *conf
- resolv.conf olsrd.conf nsswitch.conf host.conf cbu.conf
- # cat cbu.conf
- #### ARQUIVO DE CONTROLE DE BANDA - AP ROUTER NG ####
- ### ESTE ARQUIVO TRABALHA EM CONJUNTO COM AS CONFIGURACOES VIA WEB ###
- ### LINHAS COMECANDO COM "#" SAO COMENTARIOS ###
- ### !!! ATENCAO !!! ###
- ## APOS EDITAR E SALVAR ESTE ARQUIVO VIA TERMINAL SSH, EXECUTE OS 2 COMANDOS ABAIXO
- ##NESSA ORDEM:
- ## cbu.sh
- ## firewall.sh
- ## E NAO ESQUECA DE SALVAR A ESTRUTURA DO DIRETORIO COM O COMANDO:
- ## salvar
- ### CONTROLE DE BANDA POR IP ###
- ## NAO ESQUECER DE HABILITAR O CONTROLE DE BANDA POR IP VIA INTERFACE WEB
- ## Coloque abaixo os enderecos IPs dos clientes a serem controlados
- ## um por linha, seguindo o exemplo de formato abaixo:
- ##
- ## ID DO GRUPO,ENDERECO IP,RATE DE SAIDA LAN,RATE DE SAIDA WAN,COMENTARIO
- ##QUALQUER
- ##
- ## O formato acima segue o mesmo principio do controle de banda via WEB
- ## EX:
- #0,192.168.2.3,256,256,Joao da Silva
- #0,192.168.2.0/24,128,128,Toda a rede 192.168.2.xxx
- ### CONTROLE DE BANDA POR MAC ###
- ## NAO ESQUECER DE HABILITAR O CONTROLE DE BANDA POR MAC VIA INTERFACE WEB
- ## Coloque abaixo os enderecos MACs dos clientes a serem controlados
- ## um por linha, seguindo o exemplo de formato abaixo:
- ##
- ##ID DO GRUPO,ENDERECO MAC,RATE DE SAIDA LAN,RATE DE SAIDA WAN,COMENTARIO
- ##QUALQUER
- ##
- ##
- #0,00:4f:62:04:54:12,256,256,Joao da Silva
- #0,00:4f:62:04:54:13,128,128,Maria
- # ls
- config.dat upload.asp password.asp ethers.asp
- wlwpa.asp title.htm opmode.asp dmz.asp
- wlwep.asp tcpipwan.asp ntp.asp discover.asp
- wlwdstbl.asp tcpiplan.asp mtmcode.js dhcptbl.asp
- wlwdsenp.asp syslog.asp menu-images ddns.asp
- wlwds.asp syscmd.asp menu_empty.html css
- wlsurvey.asp status.asp menu.asp common.js
- wlstatbl.asp stats.asp macfilter.asp code.asp
- wlbasic.asp sinal.asp logout.asp cbu.asp
- wladvanced.asp script.asp licenca.asp bandlimit.asp
- wlactrl.asp saveconf.asp ipfilter.asp aplicar.asp
- wizard.asp reboot.asp ipalias.asp
- webport.asp portfw.asp home.asp
- watchdog.asp portfilter.asp graphics
- # cat password.asp
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link rel="stylesheet" href="css/aprouter.css" type="text/css">
- <title>Password configuration</title>
- <% language=javascript %>
- <SCRIPT>
- function includeSpace(str)
- {
- for (var i=0; i<str.length; i++) {
- if ( str.charAt(i) == ' ' ) {
- return true;
- }
- }
- return false;
- }
- function saveChanges()
- {
- if ( document.password.username.value.length == 0 ) {
- if ( !confirm('User account is empty.\nDo you want to disable the password protection?') ) {
- document.password.username.focus();
- return false;
- }
- else
- return true;
- }
- if ( document.password.newpass.value != document.password.confpass.value) {
- alert('Password is not matched. Please type the same password between \'new\' and \'confirmed\' box.');
- document.password.newpass.focus();
- return false;
- }
- if ( document.password.username.value.length > 0 &&
- document.password.newpass.value.length == 0 ) {
- alert('Password cannot be empty. Please try it again.');
- document.password.newpass.focus();
- return false;
- }
- if ( includeSpace(document.password.username.value)) {
- alert('Cannot accept space character in user name. Please try it again.');
- document.password.username.focus();
- return false;
- }
- if ( includeSpace(document.password.newpass.value)) {
- alert('Cannot accept space character in password. Please try it again.');
- document.password.newpass.focus();
- return false;
- }
- return true;
- }
- </SCRIPT>
- </head>
- <BODY>
- <font class="texto_titulo">Configuração de Senha</font><br>
- Esta página é usada para configurar o usuário e senha que
- terá acesso ao<br>
- gerenciamento do AP. Se deixar esses campos em branco a proteção
- ficara<br>
- desabilitada.
- <hr size=1 noshade align=top>
- <form action=/goform/formPasswordSetup method=POST name="password">
- <table border="0" cellspacing="4" width="500">
- <tr>
- <td width="20%"><strong>Nome
- de Usuário:</strong></td>
- <td width="50%"><input type="text" name="username" size="20" maxlength="30"></td>
- </tr>
- <tr>
- <td width="20%"><strong>Nova
- Senha:</strong></td>
- <td width="50%"><input type="password" name="newpass" size="20" maxlength="30"></td>
- </tr>
- <tr>
- <td width="20%"><strong>Confirmar
- Senha:</strong></td>
- <td width="50%"><input type="password" name="confpass" size="20" maxlength="30"></td>
- </tr>
- </table>
- <input type="hidden" value="/status.asp" name="submit-url">
- <input type="submit" value=" Salvar " name="save" onClick="return saveChanges()">
- <input type="reset" value="Restaurar" name="reset">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement