Michael Orlitzky [Mon, 23 Oct 2017 20:27:00 +0000 (16:27 -0400)]
untangle.py: add support for v13.1 download URLs.
In version 13.1 of Untangle, the backup download URL has changed. That
means we need to support a new, non-integer version number "13.1". This
commit changes the version parameter from an integer to a string, and
adds support for two new version strings: "13" and "13.1".
Since the download URL was unchanged in v13.0, the existing routines
are used for that version. However, a new get_backup_v13_1() function
was added for v13.1. The only difference between that function and the
get_backup_v10() function is the word "webui" which has been changed
to "admin".
Version "13.1" is now the default version if none is specified.
Remove a querystring parameter to fix v12.2 backups.
In the v10 backup routine, we were passing "type=backup" as part of
the querystring in addition to POSTing it. This was causing a problem
with one v12.2 host, and that's why I'm just going to blame v12.2 for
the problem. It looks like the querystring parameter is not needed for
any of the other versions/hosts that I've tested against.
Rename the executable, and implement a bunch of missing stuff.
This adds chmod of the backups, default options, SSL verification, and
cleans up some of the errors. It also supports command-line parsing
and a user-specified configuration file.