Quote:
you have the time. If you have further questions or my explanation was TOO detailed/not detailed enough, give's a yell ;) Quote:
And I'm German of slovene origin living in New Zealand ;) Cheers, Tink |
HI ya Tink,
How's your weekend going? Mine is okay. So far, I've written the script but I'm having problems making it an executable file. I tried using chmod a + x on it but when I try to run it, I can't. But anyway, I wanted to let you see what I've done so far. Like I said, I haven't been able to test it at all yet. Like you said, I first have to make it an executable file, correct? Maybe you could help me with that? Thanks. ------------------------------------------------------------------------------------------------- # This shell script was written by Scott Pioso, with the help of Tinkster to # allow network administrators to automate the downloading of Norton Anti-Vir- # us daily virus definition updates (Intelligent Updater) to be downloaded # automatically to a linux server for distribution to clients running an . # This script is freely distributable and the author claims no copyright or any # other proprietary hold on it. # You may freely modify or adjust this script as you see fit #!/bin/bash cd /software/NortonDefs wget http://securityresponse.symantec.com...es/US-N95.html for getIt in 'awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html' do wget http://securityresponse.symantec.com/$getIt done |
Quote:
What error/problem are you facing with running it? How were you trying to run it? Cheers, Tink |
Hi ya tink,
What I did after I wrote the script was this: cd'd into the proper directory and chmod 754 for the file norton.sh Then I did the following: [root@ASUSA7V266-E software]# ls Adaware.tar.gz MSConfig-Windows2000.tar.gz Soundblaster.tar.gz Adobe.tar.gz MSOffice.tar.gz SystemCleaner.tar.gz Cisco Configmaker.tar.gz NortonDefs tomsrtbt-2.0.103.tar.gz gaim-0.72-1rh9.i386.rpm norton.sh Trillian.tar.gz Intel.tar.gz Norton.tar.gz Trojan.tar.gz LinuxUtilities.tar.gz PQMagic.tar.gz vnc-3.3.7-1.i386.rpm lost+found putty.tar.gz VNCforWindows.tar.gz MeayaPopupFilter.tar.gz Quicken.tar.gz vnc-linux.tar.gz Moosoft.tar.gz RegCleaner.tar.gz Mozilla.tar.gz Roxio.tar.gz [root@ASUSA7V266-E software]# [root@ASUSA7V266-E software]# norton bash: norton: command not found [root@ASUSA7V266-E software]# norton.sh bash: norton.sh: command not found [root@ASUSA7V266-E software]# Obviously, I'm doing something wrong, and I know it's simple, I just don't know what to do to fix it so it will run as a script. Here also is the script that I wrote: -------------------------------------------------------------------------------------------------- # This shell script was written by Scott Pioso, with the help of Tinkster to # allow network administrators to automate the downloading of Norton # Anti-virus daily virus definition updates (Intelligent Updater) # to be downloaded # automatically to a linux server for distribution to clients running a # graphical user interface from another well known GUI OS manufacturer. # This script is freely distributable and the author claims no copyright # or any other proprietary hold on it. # You may freely modify or adjust this script as you see fit #!/bin/bash # This statement is the default directory that you should create on your # Linux system. You may change this if you see fit. cd /software/NortonDefs # This next statement automatically will call the system to download the files # necessary from the Norton.com website. wget http://securityresponse.symantec.com...es/US-N95.html for getIt in 'awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html' do wget http://securityresponse.symantec.com/$getIt done -------------------------------------------------------------------------------------------------- Thanks for your help again! |
Quote:
For safety reasons the local directory isn't in root's path for a (probably not too obvious) security reason. Imagine a evil user with a local account on your machine created a bash-script called ls containing rm -rf /, and put that into /tmp ... if you (as root) go into /tmp, and do an ls to look at the directory, you could wipe your HDD ... therefore, if you need to execute a file in a local directory, you need to preceed it with ./ (or use the fully qualified path). Cheers, Tink |
Hmm, got it now, however, I'm getting some errors here. Check it out. . .
root@ASUSA7V266-E software]# ./norton.sh --16:12:23-- http://securityresponse.symantec.com...es/US-N95.html => `US-N95.html' Resolving securityresponse.symantec.com... done. Connecting to securityresponse.symantec.com[64.124.201.45]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 13,224 [text/html] 100%[====================================>] 13,224 137.38K/s ETA 00:00 16:12:23 (137.38 KB/s) - `US-N95.html' saved [13224/13224] ./norton.sh: line 23: unexpected EOF while looking for matching `"' ./norton.sh: line 28: syntax error: unexpected end of file |
Also I just found that it's downloading the entire page, not just the zips and exe from the page. Why is that happening do you think?
|
Quote:
replaced the Code:
` Code:
' I wouldn't know ... maybe you have a different version of wget, maybe there's an alias, ... Run the wget manually, check whether the entire site comes, or just the page you actually requested. Cheers, Tink |
Hi Tink,
I don't know either, however, what seems to be happening when I run the script manually is it apparently is running the script in two steps. If you look, after it downloads, it apparently returns to normal shell prompt and then tries to run awk. Which I have to assume it doesn't know what to do with it. [root@ASUSA7V266-E scott]# wget http://securityresponse.symantec.com...es/US-N95.html --17:04:11-- http://securityresponse.symantec.com...es/US-N95.html => `US-N95.html' Resolving securityresponse.symantec.com... done. Connecting to securityresponse.symantec.com[209.8.166.179]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 13,224 [text/html] 100%[====================================>] 13,224 167.72K/s ETA 00:00 17:04:11 (167.72 KB/s) - `US-N95.html' saved [13224/13224] [root@ASUSA7V266-E scott]# for getIt in 'awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html' > do > wget http://securityresponse.symantec.com/$getIt > > done > |
Quote:
using the wrong quotes .... Code:
[root@ASUSA7V266-E scott]# for getIt in `awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html` Cheers, Tink |
I'm sorry? I'm not exactly following you. I'm using the single quote which is right below the double quote key to the right of the colon keys ;: Which quote should I be using?
|
Quote:
to the ~ (tilde) character) ... Cheers, Tink |
ah ha!! Okay, well, so every place where you see a single quote should have that type instead of the one I was using, eh? Cool. Well, I'll have to continue this tomorrow as I have to take a nap now as I have to be at work in three 1/2 hours. I hate working nights. ARghhh!! Thanks a lot Tink
|
You can do this much much simpler...
Make wget filter out what files it downloads. info wget will give you that.. info wget Following\ Links Types\ Of\ Files That will tell you how to use it. Will replace that entire script with something simple :) It should be: Code:
wget -A *exe,*zip,US-N95* --follow-ftp -H -k -r -N -l 1 -w 0 -nd -e robots=off http://securityresponse.symantec.com...es/US-N95.html Just like the other one.. but this is less error prone. Also.. you don't need a script for it, just dump it into cron as is :) And.. if you know there are certain exe or zip files you never want, just add an option in there: -R <partial name with * where it fits in> |
Hi Teval,
Thanks for your input. Perhaps you can tell me how to "dump this into cron" as is. What should the name of this file be and do I still have to chmod 754 to it to make it executable? The tinkster has really tried to help me and I sure appreciated all of his help. But as I said, the script didn't do what I thought it was supposed to do. |
All times are GMT -5. The time now is 05:42 PM. |