It is currently Thu Apr 18, 2024 2:39 am

All times are UTC - 8 hours [ DST ]


Forum rules


Please, keep discussions on topic and in the right forum. The start menu topics go into the Classic Start Menu forum, etc. This makes it easier for people to locate topics they are looking for.
If you get a satisfactory response to your question, please mark the topic as "solved". Click the green √ button in the bottom-right of the post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ftp site?
PostPosted: Thu Jul 03, 2014 1:32 pm 
Offline

Joined: Tue Jan 21, 2014 11:11 pm
Posts: 9
Hi All,

I am trying to write a bash script to download Classic Shell when a new revision gets posted. The web site has some funny business on it that keeps me from being able to download it directly with wget. Do you have an ftp site I can use?

Many thanks,
-T


Top
 Profile  
Reply with quote  
 Post subject: Re: ftp site?
PostPosted: Thu Jul 03, 2014 2:21 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
How will you plan to detect when there is a new version?


Top
 Profile  
Reply with quote  
 Post subject: Re: ftp site?
PostPosted: Thu Jul 03, 2014 2:44 pm 
Offline

Joined: Tue Jan 21, 2014 11:11 pm
Posts: 9
Ivo wrote:
How will you plan to detect when there is a new version?


I am sneaky.

Code:
GetClassicShell () {
   # Status: 0 = unknown (default)
   #       1 = no update found
   #       2 = update found
   #       3 = error
   
   RtnState=0
   OldFileName=""

   NotifySound
   WorkingDir="/home/CDs/Windows/W8/ClassicShell"
   if [ ! -d $WorkingDir ]; then  mkdir $WorkingDir; fi
   cd $WorkingDir
   BaseName="ClassicShellSetup"
   Extension="exe"
   RevAddr="http://www.classicshell.net/"
   DownloadAddr="$RevAddr"

   # Turn off any read only tags
   chmod -R 766 ${BaseName}*.${Extension}; chown -R tony.users ${BaseName}*.${Extension}

   OldRev="$(ls $WorkingDir/           | \
          grep -v -i "WebSite.txt"   | \
          grep -v -i "currentversion"  | \
          grep $BaseName         | \
          sed -e 's/^..*-//'       | \
          sed -e "s/.$Extension*$//"   | \
          sort -r              | \
          sed -n 1,1p)"

   OldFileName="$WorkingDir/$BaseName-$OldRev.$Extension"

   ClickHere="$(wget --quiet "$RevAddr" -O -   | \
          grep "The latest version of Classic Shell is" | \
          sed -n '1p'            | \
          awk -F 'href="' '{print $2}' | \
          awk -F '">' '{print $1}')"

   LatestRev="$(echo $ClickHere            | \
         awk -F "_" '{print $2 "." $3 "." $4}' | \
         sed -e 's/.exe//')"

and so on and so forth ...


Top
 Profile  
Reply with quote  
 Post subject: Re: ftp site?
PostPosted: Thu Jul 03, 2014 10:56 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
Accessing the main page frequently (especially if it is done by thousands of people) will put extra load on the website.

You should use the auto-update feature. It will pop up if there is a new version and will offer to download it. It will also verify the download to prevent malicious spoofing.


Top
 Profile  
Reply with quote  
 Post subject: [solved]Re: ftp site?
PostPosted: Fri Jul 04, 2014 2:42 pm 
Offline

Joined: Tue Jan 21, 2014 11:11 pm
Posts: 9
Ivo wrote:
Accessing the main page frequently (especially if it is done by thousands of people) will put extra load on the website.

You should use the auto-update feature. It will pop up if there is a new version and will offer to download it. It will also verify the download to prevent malicious spoofing.


Actually no. This bash script is part of a 2000+ line script that goes out and downloads various utilities, drivers, etc. for a stick I carry to customer sites. I could not possible keep up with all the revision changes if I had to do it all manually.

I do not use Classic Shell on my own virtual machine copy of Frankenstein (Windows 8) as I need to be able to see what my customers (who don't ask me first) see when they first get their Frankenstein computers. So, the autoupdate feature does not apply to me.

First thing I do when I get to a customer suffering from Frankenstein is to put Classic Shell on it with their permission. They are EXTREMELY appreciative. As such I need to carry the latest version around with me. (My stick has a read-only switch so I don't catch and spread viruses.)

This would be a lot easier on me if you had an ftp site to download from. If not, how do I get around the recurrsive loop problem trying to download with wget from your web site?

Many thanks,
-T

Edit: figured out how to wget to download it: add "--referer=http://www.classicshell.net/downloads/latest" to the run string.

wget --referer=http://www.classicshell.net/ http://www.classicshell.net/downloads/latest


Love the utility. Thank you for sharing it with us!
-T


Last edited by Todd on Fri Jul 04, 2014 6:01 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: ftp site?
PostPosted: Fri Jul 04, 2014 4:35 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5333
Try using this link: www.classicshell.net/downloads/latest


Top
 Profile  
Reply with quote  
 Post subject: Re: ftp site?
PostPosted: Fri Jul 04, 2014 6:09 pm 
Offline

Joined: Tue Jan 21, 2014 11:11 pm
Posts: 9
Ivo wrote:


wget downloads it under the name of "latest", but not a problem:

NewFileName="$WorkingDir/$BaseName-$LatestRev.$Extension"
wget http://www.classicshell.net/downloads/latest --output-document "${NewFileName}"

gets around it just fine.

I have ClassicShell spread over two counties now. Customers are tickled with it. Thank you for helping me with this. Let me know if you would like to see the entire subroutine.
-T


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 93 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group, Almsamim WYSIWYG Classic Shell © 2010-2016, Ivo Beltchev.
All right reserved.