Posted 11 July 2013 - 01:29 PM
I have been working on a file updating system to roll out on my computers…
I have not got a HTTP server connection so programs have to be hand typed on a computer then transfered using a disk drive (which had to be placed and removed every time as the computers are stand alone).
This system is intended to be automatic.
here is a pastebin link to the fileserver code
http://pastebin.com/Z0Ls2rbX
edit : To use the fileserver – you MUST create two folders ( - mkdir server / mkdir client - )
edit : Just to avoid confusion these two folders must be made on your file server
This is the pastebin for the client code
http://pastebin.com/rGuCZh8N
edit : my fileserver is id 1.. change your fileserver id in the file to match your fileservers id in your client code.
the client code runs the update, then after the final command "bt.eol" - end of list - it then runs a set of shell commands to delete itself, rename the update of itself to its own name, calls the startup file and exits with the error "File updates finished" you can even update the program that is running the updates!!
I built a file structure to be \\server\\ files and \\client\\ files
This currently only supports a client and server profile but expanding to more clients would be pretty easy.
My plands to use this on a multiplayer server mean that any computer can be installed as a client. (I have to write a server update script still. But it is basically the same but with "update_server" instead of "update_client" then it will pull the server update files from the server folder.)
I hope some people can find a use for this. (it helps to distribute new code easily)
(some of my files are 100's of lines of code, which would have meant a long rednet send message, hence I split by line) - not sure on the limits of a rednet message.
I have not got a HTTP server connection so programs have to be hand typed on a computer then transfered using a disk drive (which had to be placed and removed every time as the computers are stand alone).
This system is intended to be automatic.
here is a pastebin link to the fileserver code
http://pastebin.com/Z0Ls2rbX
edit : To use the fileserver – you MUST create two folders ( - mkdir server / mkdir client - )
edit : Just to avoid confusion these two folders must be made on your file server
This is the pastebin for the client code
http://pastebin.com/rGuCZh8N
edit : my fileserver is id 1.. change your fileserver id in the file to match your fileservers id in your client code.
the client code runs the update, then after the final command "bt.eol" - end of list - it then runs a set of shell commands to delete itself, rename the update of itself to its own name, calls the startup file and exits with the error "File updates finished" you can even update the program that is running the updates!!
I built a file structure to be \\server\\ files and \\client\\ files
This currently only supports a client and server profile but expanding to more clients would be pretty easy.
My plands to use this on a multiplayer server mean that any computer can be installed as a client. (I have to write a server update script still. But it is basically the same but with "update_server" instead of "update_client" then it will pull the server update files from the server folder.)
I hope some people can find a use for this. (it helps to distribute new code easily)
(some of my files are 100's of lines of code, which would have meant a long rednet send message, hence I split by line) - not sure on the limits of a rednet message.