LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-18-2003, 04:00 PM   #16
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928

Quote:
I really appreciate all of your help. I thought I was going to be able to get started on this today, but like so many of my days lately, I haven't been able to. See, I work nights and my days are spent mostly in bed and now I'm just getting up and I don't think now is the time to really get started on this project. I guess I'll wait until the weekend. Oh well. . .
Again, no worries ... and go for it whenever
you have the time. If you have further questions
or my explanation was TOO detailed/not detailed
enough, give's a yell ;)


Quote:
Hey, if you're ever in the area, look me up. Where are you from anyway? I'd have to guess by your use of language that you're from Austrailia?
The 0800 number doesn't really indicate an area ;)

And I'm German of slovene origin living in New Zealand ;)


Cheers,
Tink

Last edited by Tinkster; 11-18-2003 at 04:02 PM.
 
Old 11-22-2003, 02:41 PM   #17
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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
 
Old 11-23-2003, 12:14 PM   #18
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by scottpioso
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.
Weekends are always too short ;}

What error/problem are you facing with running
it? How were you trying to run it?

Cheers,
Tink
 
Old 11-23-2003, 03:53 PM   #19
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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!
 
Old 11-23-2003, 04:12 PM   #20
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by scottpioso
[root@ASUSA7V266-E software]# norton
bash: norton: command not found
[root@ASUSA7V266-E software]# norton.sh
bash: norton.sh: command not found
Yep ... try ./norton.sh

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
 
Old 11-23-2003, 04:17 PM   #21
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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

Last edited by scottpioso; 11-23-2003 at 04:22 PM.
 
Old 11-23-2003, 04:22 PM   #22
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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?
 
Old 11-23-2003, 05:00 PM   #23
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by scottpioso
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?
The error seems to be that you have
replaced the
Code:
`
around the entire awk statement with
Code:
'
As for the fact that it downloads EVERYTHING,
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
 
Old 11-23-2003, 05:11 PM   #24
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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
>
 
Old 11-23-2003, 05:18 PM   #25
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by scottpioso
[root@ASUSA7V266-E scott]# for getIt in 'awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html'
If the board didn't change them you're still
using the wrong quotes ....
Code:
[root@ASUSA7V266-E scott]#   for getIt in `awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html`

Cheers,
Tink
 
Old 11-23-2003, 05:26 PM   #26
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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?
 
Old 11-23-2003, 06:44 PM   #27
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by scottpioso
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?
The one above the TAB key (primary function
to the ~ (tilde) character) ...

Cheers,
Tink
 
Old 11-23-2003, 06:57 PM   #28
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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
 
Old 11-23-2003, 07:21 PM   #29
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
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
Yes.. it does download 4 extra html files, but it deletes them immediately, and doesn't get the gif files from them or anything. All.. you get is.. 1 html file and all the exe files you want.
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>

Last edited by teval; 11-23-2003 at 07:23 PM.
 
Old 11-24-2003, 07:58 AM   #30
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Jobs XaViaR Linux - General 1 06-23-2005 06:57 PM
Cron Jobs with MySQL SharkBait Mandriva 1 06-07-2005 01:23 AM
cron jobs working2hard Linux - Software 0 07-28-2004 05:31 PM
cron jobs Zyanid Linux - Software 0 08-27-2002 05:10 AM
creating cron jobs jonfa Linux - General 5 05-26-2002 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration