I am having a bit of an issue.
I have a file, hosted on a remote server (http://mywebsite/file.zip).
I also have a few embedded linux boxes (running openelec OS). The boxes have fairly limited commands, but they still have the basic – curl, bash, etc. They all have the file stored on them (/storage/file.zip)
What I am trying to do is – I need to set up a script, which executes in the first minute after the device is fully booted, and it will probably use curl to check if the remote server file (mywebsite/file.zip) is newer than the local one (/storage/file.zip), and instead of downloading it if it is newer – it needs to execute a bash script (/storage/scripts/script.sh)
I generally use this command "curl -o /storage/file.zip -z /storage/file.zip http://website/file.zip" but I have no idea how to make it execute the script, instead of download the file. Not even sure if it is possible at all.
All help is greatly appreciated!
Also, just to make sure – it needs to execute only if localfile is OLDER than remotefile. If localfile is newer than remotefile – it does not need to execute the script, as the script that is executed is also downloading the remote file from server, hence after it is executed – localfile will be with a newer timestamp, which if not specified that the script is executed only on remotefile newer – it might end in a endless loop.