curl-library
Re: Ubiquiti
Date: Tue, 18 Apr 2017 17:19:36 +0200
On Tue, Apr 18, 2017 at 07:52:35AM -0600, Greg Stewart via curl-library wrote:
> I am working with Ubiquiti airMax products. I'm trying to get logged in and
> change the device configuration.
I actually had to do exactly that a few weeks ago. What I ended up doing is:
COOKIEFILE=$(mktemp)
curl -s -k -b $COOKIEFILE -c $COOKIEFILE -o /dev/null https://192.168.1.20/
curl -s -k -b $COOKIEFILE -c $COOKIEFILE -o /dev/null -H 'Expect:' -F uri=/ -F username=ubnt -F password=ubnt -F country=56 -F ui_language=en_US -F lang_changed=no https://192.168.1.20/login.cgi
cat picostation.cfg | curl -s -k -b $COOKIEFILE -c $COOKIEFILE -o /dev/null --referer 'https://192.168.1.20/system.cgi' -H 'Expect:' -F update_status=enabled -F 'hostname=PicoStation M2' -F adminname=ubnt -F cfgfile=@- -F cfgupload=Upload -F action=cfgupload https://192.168.1.20/system.cgi
curl -s -k -b $COOKIEFILE -c $COOKIEFILE -o /dev/null https://192.168.1.20/apply.cgi
(the "cat picostation.cfg" is different, as we partly generate the config from another script)
Frank
-- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2017-04-18