Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Compilando Xen-3.3.1
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
marcosmilk  
View profile   Translate to Translated (View Original)
 More options Jun 30, 12:20 pm
From: marcosmilk <marcosm...@gmail.com>
Date: Tue, 30 Jun 2009 09:20:51 -0700 (PDT)
Local: Tues, Jun 30 2009 12:20 pm
Subject: Compilando Xen-3.3.1
Boa tarde.

Estou criando um script de instalação do Xen-3.3.1, onde esse script
baixa e compila e joga a saida da compilacao para um arquivo "/tmp/
comp_xen" verifica se tem algum error e caso tenha erros aborta a
instalação, caso não encontre nenhum erro o script continua com a
instalação até finalizar com reboot do sistema operacional para que em
seguida seja criada as maquinas virtuais.

Desejo saber se tem alguma maneira de na compilação ele responder as
pergunta automaticamente, algum default para as respostas.

Agradeço pela ajuda.

Abraço!!!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rogerio Ferreira  
View profile   Translate to Translated (View Original)
 More options Jun 30, 12:30 pm
From: Rogerio Ferreira <rogerio...@gmail.com>
Date: Tue, 30 Jun 2009 13:30:21 -0300
Local: Tues, Jun 30 2009 12:30 pm
Subject: Re: [xen-br] Compilando Xen-3.3.1

Você pode usar expect, segue abaixo um exemplo de expect, respondendo a um
ssh e scp:

#!/bin/sh
# Autor: Rogerio Ferreira

HOST="$1"
USER="$2"
PASS="$3"
DIR_SRC="$4"
DIR_DST="$5"
DATE=$(date --date='yesterday' +'%F')
EXT="$6"

conn_ssh_list() {
  expect -c "
    set timeout -1
    spawn ssh $USER@$HOST ls -ltr --full-time $DIR_SRC/*.$EXT
    expect \"*assword: \" {send \"$PASS\r\"}
  expect eof"

}

conn_ssh_copy() {
  FILES=$(conn_ssh_list | grep $DATE | awk '{print $9}')

  for FILE in $FILES
  do
    expect -c "
      set timeout -1
      spawn scp $USER@$HOST:$FILE $DIR_DST/
      expect \"*assword: \" {send \"$PASS\r\"}
    expect eof"
  done

}

conn_ssh_copy

No script acima, o comando ssh e scp solicitam que o usuário entre com uma
senha e enter. Então quando qualquer comando do seu script solicitar alguma
intervenção humana, usa expect.

Para instalar expect do debian: aptitude install expect
No CentOS: yum install expect

--
Rogerio Ferreira
http://rogerioferreira.objectis.net
--------------------------------------------------------
LPI 302 (Mixed Environment) Specialty
Senior Level Linux Professional (LPIC-3)
Advanced Level Linux Professional (LPIC-2)
Junior Level Linux Professional (LPIC-1)

2009/6/30 marcosmilk <marcosm...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcosmilk  
View profile   Translate to Translated (View Original)
 More options Jun 30, 1:15 pm
From: marcosmilk <marcosm...@gmail.com>
Date: Tue, 30 Jun 2009 10:15:55 -0700 (PDT)
Local: Tues, Jun 30 2009 1:15 pm
Subject: Re: Compilando Xen-3.3.1
Rogério!

Primeiramente muito obrigado por responder

Veja se entendi.

Terei q fazer o Make world da seguinte maneira?

expect -c "make world"

São várias perguntas feitas durante a compilação onde a resposta
default d algumas perguntas é N e outras perguntas Y, dentre outras
opções.

O "-c" seria para respostas default mesmo?

On 30 jun, 13:30, Rogerio Ferreira <rogerio...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rogerio Ferreira  
View profile   Translate to Translated (View Original)
 More options Jun 30, 1:23 pm
From: Rogerio Ferreira <rogerio...@gmail.com>
Date: Tue, 30 Jun 2009 14:23:47 -0300
Local: Tues, Jun 30 2009 1:23 pm
Subject: Re: [xen-br] Re: Compilando Xen-3.3.1

expect -c "
    set timeout -1
    spawn *make world*
    expect \"**yesno* \" {send \"*Y*\r\"}
expect eof"

Vamos supor que a após o comando make world, o prompt que irá aparecer será
yesno, pedindo um confirmação com Y ou N. A instrução expect espera pela
string de um prompt qualquer e a instrução send envia a solicitação.

2009/6/30 marcosmilk <marcosm...@gmail.com>

--
Rogerio Ferreira
http://rogerioferreira.objectis.net
--------------------------------------------------------
LPI 302 (Mixed Environment) Specialty
Senior Level Linux Professional (LPIC-3)
Advanced Level Linux Professional (LPIC-2)
Junior Level Linux Professional (LPIC-1)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcosmilk  
View profile   Translate to Translated (View Original)
 More options Jun 30, 2:32 pm
From: marcosmilk <marcosm...@gmail.com>
Date: Tue, 30 Jun 2009 11:32:09 -0700 (PDT)
Local: Tues, Jun 30 2009 2:32 pm
Subject: Re: Compilando Xen-3.3.1
E no caso quando dou o comando make world ele possui várias perguntas,
ae ficaria tipo:
   set timeout -1
>       spawn *make world*
>       expect \"**yesno* \" {send \"*Y*\r\"}

        expect \"**yesno* \" {send \"*Y*\r\"}
        expect \"**yesno* \" {send \"*y*\R\"}

>  expect eof"

um expect para cada pergunta q ele me envia?

E tem alguma meneira dele jah responder a opção default? É q tem
alguma opçoes em q a resposta é "Y\n\m "outras perguntas a resposta é
"y\n\M" e outras perguntas a resposta é "y\n\N", tem alguma maneira
dele já passar a default?

On 30 jun, 14:23, Rogerio Ferreira <rogerio...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gunther boeckmann  
View profile   Translate to Translated (View Original)
 More options Jun 30, 7:30 pm
From: gunther boeckmann <guntherboeckm...@gmail.com>
Date: Tue, 30 Jun 2009 20:30:52 -0300
Local: Tues, Jun 30 2009 7:30 pm
Subject: Re: [xen-br] Re: Compilando Xen-3.3.1

Pessoal, sugiro vocês discutirem questões de shell script diretamente apenas
entre vocês.

Abraços,
Gunther

2009/6/30 marcosmilk <marcosm...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google