I posted a linux script I use to change parameters on my cameras based upon sunrise and sunset a couple of years ago. Might take a little bit of work to find it but its here in the forum somewhere.
To figure out what to send, use something like Fiddler or Charles Proxy to watch the data being sent to the camera when you execute a command. Then you can replicate the same thing on your end by creating an xml file and injecting it to the camera using curl.