Extraindo variaveis Shell Script

1. Extraindo variaveis Shell Script

Perfil removido
removido

(usa Nenhuma)

Enviado em 16/06/2010 - 20:48h

#!/bin/bash

Origem=""
Destino=""
Porta=""

#while true; do


teste=$(dialog --stdout \
--radiolist 'ADICIONAR REGRAS NAT:' 0 0 0 \
'1' 'TCP/UDP' ON \
'2' 'IP' OFF \
'3' 'OUTROS' OFF
'4' 'Voltar' OFF
'5' 'SAIR'OFF )

if [ "$teste" == "1" ]; then
teste="$VALUES"
else
exit
fi

# open fd
exec 3>&1
VALUES=$(dialog --ok-label "Ok" \
--backtitle "GFLY FW" \
--title "ADICIONAR REGRAS NAT" \
--form "Configuracoes do Firewall" \
15 50 0 \
"Origem:" 1 1 "$origem" 1 10 17 0 \
"Destino:" 2 1 "$destino" 2 10 17 0 \
"Porta:" 3 1 "$porta" 3 10 40 0 \
2>&1 1>&3)

# close fd
exec 3>&-

protocolo=$(dialog --stdout --radiolist "Protocolo:" 0 0 3 TCP "" on $
[ $? -ne 0 ] && continue
acao=$(dialog --stdout --radiolist "Acao:" 0 0 3 LIBERAR "" on BLOQUE$
[ $? -ne 0 ] && continue

echo "$VALUES"
echo "$protocolo"
echo "$acao"

Obs: Gostaria de de extrai ou desmembrar as variaveis $origem, $destino e $porta da variavel $VALUES, pois quando eu jogar o comando do iptables eu pegue separadamente cada variavel.....

Muito Obrigado....


  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts