| View previous topic :: View next topic |
| Author |
Message |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Fri Feb 08, 2013 7:00 pm Post subject: Auto update script |
|
|
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 yet i posted anyway. If anyone has any other ideas on how to make this pelase reply.[/b] _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Feb 08, 2013 7:42 pm Post subject: Re: Auto update script |
|
|
| 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... _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Fri Feb 08, 2013 7:46 pm Post subject: |
|
|
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 _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Feb 08, 2013 8:14 pm Post subject: |
|
|
Then go with clumsy. Those fields I mention are there for exactly the purpose you describe. To not use them is illogical.
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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sat Feb 09, 2013 3:52 am Post subject: |
|
|
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® |
|
| Back to top |
|
 |
|