Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
99 user(s) are online (53 user(s) are browsing Forums)

Members: 1
Guests: 98

root, more...

Headlines

 
  Register To Post  

wget a little help
Quite a regular
Quite a regular


See User information
I use wget with this function,
I created a file with a list of files to be downloaded automatically

example:
NewShell
RAM:
wget -i list <---- files with the list of files to download
http://os4depot.net/share/development/utility/autodocviewer.lha
http://os4depot.net/share/emulation/gamesystem/amiarcadia.lha
http://os4depot.net/share/network/server/ftp/zitaftpserver.lha

there is a function to unzip the files once I have finished downloading the files automatically I have some utility that can be used with AmigaOs 4.1FE to do this through a script to manage the .LHA archives
eventually it would be more convenient from the command line if possible.

Thanks for any help

Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
@white

AmigaOS include in C the "foreach" command you can use like this f.e. if this is your question:

Foreach i in #?.lha
C:lha x "$i"
End


Regards,
Petrol

Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
Hi Petrol,
I tried your solution, but I can't understand the syntax I should use (and my mistake definitely)

"wget -i list" is the initial command
this downloads the files that will go to ram:

At that point I need the command you suggested to extract all the ram files: (just downloaded) without any distinction, extracting all the .lha files found in ram:

Thanks again for your patience.

I put the video lasts a few seconds, I hope it can be easier to help me.
https://www.youtube.com/watch?v=dAhRMjBF1_w

Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
You could try like this:

Create a new text file and copy your code inside:
C:wget -list
Foreach 
i in #?.lha
C:lha x "$i"
End


Save it to ram:
Do a right clic on its icon and choose "Information"
Tick the script box
In the icon tab, in default tool, replace the textviewer by "C:IconX"
Save your icon information (Click save)

Now if you double click on your script icon, it will run the script and not the textviewer.

It will launch the wget programm first and download the files from your list.
Once the files downloaded, it will look for each lha files and extracts them (i represents the lha file).

Regards,
Petrol.

Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
Hi Petrol, thanks for your help
the script works perfectly, and would also work first
because if I put an archive in ram:

example:
unrar.lha

the script
Foreach i in # ?. lha
C: lha x "$ i"
End

It works perfectly.

but if I use for example wget -i list
the files are downloaded but with these names
download.php?=network2Fserver%%2Fftpzitaftpserver.lha

I don't know the reason, probably the file name is too long or I'm wrong to set:
wget -i list
to download the files.

because if I put any archive downloaded for example with Odyssey in ram the script to extract it works perfectly.

What do you think about it?
Thanks again

Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
I looked on the net and it semés you need to add --content-dispositionto your wget command
Try :
Wget --content-disposition -i files.txt

Regards
Petrol

Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
@Petrol
Thank you!
now it works perfectly.
I had searched the wget "man" but could not find this option.
Thanks this helps me a lot, thanks again

Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
You're welcome, I'm glad that I could help you!
Happy scripting! ;)

Regards,
Petrol.

Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
Hi Petrol,
Thank you,
I added this option to the script and it seems to work

C:Delete ALL/.lha x "$i"

this allows once extracted the archives downloaded in .lha to delete them automatically, so as to leave only the extracted directories.

I think the syntax is correct, because it works, it doesn't seem to create any problems.

Is the syntax correct?

or could it delete any .lha files included in the directories of the extracted packages?

Thank you again.

here the video if it can be of help:
https://www.youtube.com/watch?v=LQ2-OP9Tjus


Edited by white on 2020/2/19 14:45:16
Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
@white

Lha x "$i" is the command for e »x »tract, x is an arg to lha here ,the archive $i in the loop created by the foreach ... end. I put the " "  around $i because sometimes, archives could contain space characters.

I think you could just use before the « end »:
C:Delete "$i"
Which means delete the lha file that been extracted just before.

For more informations about AmigaDOS commands, have a look at its wiki here :
https://wiki.amigaos.net/wiki/AmigaOS_ ... migaDOS_Command_Reference

Regards,
Petrol


Edited by Petrol on 2020/2/19 18:20:53
Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
Hi Petrol,
I edited it, thanks it works perfectly.
Sorry for my request,
I created with installerGEN a very complete installer for 4.1FE update1 which automatically installs all the packages needed to have the complete system.
Obviously with the request of the original CD etc.

Using the newly created initial script, is it possible to directly call the installer created without exiting the script?
It would be very convenient and clean as a code.

In case it wouldn't be possible, it doesn't matter.

I am very happy with this result.
Thanks again.

Thank you for the link.

Go to top
Re: wget a little help
Just popping in
Just popping in


See User information
Did you try to add at the end of the script, a line that calls your installer ?
Is installer the default tool type of your install script ?

So C:Installer myinstallscript should do the trick

Regards,
Petrol.


Go to top
Re: wget a little help
Quite a regular
Quite a regular


See User information
Hi Petrol,
Thanks for the suggestion, today i will try as you suggested
Thanks again.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project