Oi Fabiano,
Tudo bem???
Tentei utilizar o script que voc� forneceu no e-mail em anexo, mas n�o
funcionou. Veja a mensagem de erro que � apresentada:
[root@localhost /root]# ./atualiza.sh
Conectado na m�quina ftp.nai.com.
220 sncwebftp1 FTP daemon ver. 7.4 .
Palavra chave cd no .netrc desconhecida
Palavra chave pub/antivirus/datfiles/4.x no .netrc desconhecida
Palavra chave bin no .netrc desconhecida
Palavra chave prompt no .netrc desconhecida
Palavra chave mget no .netrc desconhecida
Palavra chave dat-*.tar no .netrc desconhecida
Palavra chave close no .netrc desconhecida
Palavra chave bye no .netrc desconhecida
331 Anonymous access allowed, send identity (e-mail name) as password.
230-You are connected to ftp.nai.com.
230-Your use is subject to the terms and conditions in Legal.TXT
230-and Usage.TXT files
230-*Mirror sites at FTPEUR.NAI.COM and FTPDE.NAI.COM*
230 Anonymous user logged in.
./atualiza.sh: syntax error near unexpected token `else'
./atualiza.sh: ./atualiza.sh: line 30: `else'
[root@localhost /root]#
Voc� sabe como posso resolver esse problema?
Desde j� agrade�o a aten��o.
Abra�os,
Roberth.
> Ola Marcos,
>
> Vc precisa de dois arquivos: um .netrc, para baixar os DATs, e o
outro
> um script (atualiza.sh) que instala as novas versoes.
> Estou lhe enviando um exemplo (retirado da propria documentacao do
> VirusScan), qquer duvida, entre em contato.
>
>
> ###### Inicio .netrc ############
> #Atualizacao DATs VirusScan
> machine ftp.nai.com
> login anonymous
> password [EMAIL PROTECTED]
> macdef init
> cd pub/antivirus/datfiles/4.x
> bin
> prompt
> mget dat-*.tar
> close
> bye
> ###### Fim .netrc ###############
>
> ###### Inicio atualiza.sh #######
> #!/bin/sh
>
> # Assume uvscan is installed in the same directory
> # as this script.
>
> install_directory=`dirname $0`
>
> # Create a download directory
>
> mkdir /tmp/dat-updates
>
> cd /tmp/dat-updates
>
> # Get the version of the currently installed .DATs
> # from the info given by the --version switch
>
> current_version=`
> $install_directory/uvscan --version | grep "Virus data file" | awk '{
> print substr($4,2,4) }'`
>
> # Get the new .DATs.
> # The entry in your .netrc file should take care
> # of the downloading.
>
> ftp ftp.nai.com
>
> # Get the version of the new .DATs from the filename.
>
> new_version=`echo dat-*.tar | awk '{ print substr($1,5,4) }'`
>
> # If they are the same age or older than the current ones,
> # do not install them
>
> if [ "$current_version" -ge "$new_version" ]
> then
> echo "No new .DATs available at this time"
> echo "Currently installed version: $current_version"
> echo "Version on FTP site: $new_version"
> else
> tar -xf dat-*.tar
>
> # Move them to the install directory, making sure
> # the filename is lower case.
>
> for file in `tar -tf dat-*.tar`
> do
> newfile=`echo $file | tr [A-Z] [a-z]`
> mv ./$file $install_directory/$newfile
> done
>
> # Get the current version again and make sure
> # the new .DATs installed correctly.
>
> current_version=`
> $install_directory/uvscan --version | grep "Virus data file"
|
> awk '{ print substr($4,2,4) }'`
> if [ ! "$current_version" -eq "$new_version" ]
> then
> echo "DAT file updates did not work correctly."
> echo "Please try manually."
> fi
> fi
>
> # Delete the directory that you created.
>
> cd /
> rm -fr /tmp/dat-updates
>
> ###### Fim atualiza.sh ###########
================================
Veronica Vieira de Carvalho
Roberth Oliveira Corgosinho
http://www.netfor.com.br
Assinantes em 12/03/2002: 2227
Mensagens recebidas desde 07/01/1999: 157942
Historico e [des]cadastramento: http://linux-br.conectiva.com.br
Assuntos administrativos e problemas com a lista:
mailto:[EMAIL PROTECTED]