This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Auto update script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Auto update script

Post by Madalin »

I want to know what the best way to auto update a script. I want to create a script like this. I want to get all my scripts work with this meaning that all my scripts could auto update themselfs (or manually).

I was thinking at something like this:

Script
1. The script itself will check a page on a domain for the script version (if the version is other) the script will wget the new file and remove the old one (or make a backup of it)
2. The bot will rehash/restart depending on the modification

Website
1. Every tcl script will have a folder or its own (.tcl and .info). The script will check the .info file and see if the script was updated or not
2. For the public scripts i will want to make a specific file so that every public script will contain a specified KEY (if key is invalid he wont be able to wget the file) if its valid he will

For the public scripts i think a manually command would be better than an automated proc

The part with they key i think it would be harder :D yet i posted anyway. If anyone has any other ideas on how to make this pelase reply.[/b]
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Auto update script

Post by speechles »

Madalin wrote:I want to know what the best way to auto update a script.
Using the ETag or Last-Modified field within the reply header is easier. You wont need to read a page body, aka [::http::data] which means less bandwidth to check when an update is required...
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

I don`t think that was the problem because making a simple .txt page with a number (the version) and making the bot read that wouldnt make the bot take to much bandwith. The think was if the my idea on how to update a script is the best way or not. If does steps are correct or i need another plan
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Then go with clumsy. Those fields I mention are there for exactly the purpose you describe. To not use them is illogical.
!webby http://ereader.kiczek.com/scripts/autogoogle.tcl
> No Title ( http://is.gd/gS8eHs )( 200; application/x-tcl; iso8859-1; 6934 bytes )( 1y, 1h, 48m, 16s ago )

!webby http://ereader.kiczek.com/scripts/incith-fml.tcl
> No Title ( http://is.gd/RDbagE )( 200; application/x-tcl; iso8859-1; 26975 bytes )( 4w, 1d, 3h, 50m, 51s ago )
I can tell very simply how old my scripts are on my site. Simple is best.


To do what you want is easy:
<for the main script>
Download the new script as somescript.new.tcl
Rename current version of the script as somescript.old.tcl
(If somescript.old.tcl exists before the rename, delete it before you rename.)
Now rename the new script from somescript.new.tcl to somescript.tcl

<for the config>
Make sure the config is something like: somescript.config.tcl
In the main script, source somescript.config.tcl

Now you can easily auto-update the script without bothering the user that you've ever done anything. Magic. Their config is never touched. Their settings remain the same.

Incith-google has an easter-egg (unexplained feature) that does this. You put settings you change from defaults in a file called "incith-google-settings.tcl". Any variables set in there are sourced after it creates the defaults. Thereby over-riding those defaults with custom values. It's all quite simple in design.
S
SmasHinG
Voice
Posts: 29
Joined: Mon Aug 29, 2011 2:58 am

Post by SmasHinG »

And here is the question how to get setting from old tcl to import in new tcl :)
Madalin your idea is great but this think you want to auto update okay but setting for every tcl how to change from old tcl to new :) That`s the big problem of your idea :)
SmasHinG®
Post Reply