shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dialog le varialvel de forma errada


From: Marcos Magalhães
Subject: dialog le varialvel de forma errada
Date: Wed, 16 Nov 2005 14:39:17 -0300

Boa tarde senhores,

estou desenvolvendo um pequeno script de manutenção de firewall, em uma das
telas apresento ao usuário o conteudo de um arquivo onde cada liha é um
registro porem quando vou ler o arquivo e passar para o dialog ele embaralha
tudo, abaixo segue o código do script

#################### ARQUIVO DE DADOS
#######################################
#eth_int #ORIGEM DESTINO PROTOCOLO PORTAS
eth1 192.168.1.0/24 <http://192.168.1.0/24> 192.168.1.1
<http://192.168.1.1>tcp 3128,21,80,53,22,443
eth1 192.168.1.0/24 <http://192.168.1.0/24> 192.168.1.1
<http://192.168.1.1>udp 53,67
eth2 192.168.2.0/24 <http://192.168.2.0/24> 192.168.2.1
<http://192.168.2.1>tcp 3128,21,80,53,22,443,5901
eth2 192.168.2.0/24 <http://192.168.2.0/24> 192.168.2.1
<http://192.168.2.1>udp 53,67
###############################################################################
#!/bin/bash

. /etc/firewall/firewall.conf # pega algumas variaveis

_OPT=$(grep -ve "^#" $PORT_RED_INT | sed -e "s/^/'/g" -e "s/$/'/g" | nl)

# tira as linhas comentadas, coloca aspas no inicio e no fim e numera as
linhas o retorno de um echo da variável e isso :
# 1 'eth1 192.168.1.0/24 <http://192.168.1.0/24>
192.168.1.1<http://192.168.1.1>tcp 3128,21,80,53,22,443' 2 'eth1
192.168.1.0/24 <http://192.168.1.0/24> 192.168.1.1 <http://192.168.1.1> udp
53,67 ' 3 'eth2 192.168.2.0/24 <http://192.168.2.0/24> #
192.168.2.1<http://192.168.2.1>tcp 3128,21,80,53,22,443,5901' 4 'eth2
192.168.2.0/24 <http://192.168.2.0/24> 192.168.2.1 <http://192.168.2.1> udp
53,67 '


dialog --title " teste " --menu " OI " 0 0 0 $_OPT
# aqui ele bagunça tudo ele joga aleatoriamente os valores dentro do Menu do
dialog
################### CÓDIGO DO SCRIPT
#########################################

O mais engraçado é que se eu pegar o retorno do echo e colar no script e
funciona na boa


ufa enrolei pra caramba, espero que os senhores possam me ajudar

de ante-mão agradeço a todos

--
-------------------------------
Marcos André Magalhães
Network | Linux
Linux User n. 360076
-------------------------------


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]