The attached opgtool script allows you to unpack, view, modify and re-package OPG configuration backup files.
The OPG file format is a tarball of the appliance's entire configuration ( /etc/config/*), headed with three null-delimited fields containing the vendor, model and version of the appliance that configuration was exported or backed up from. When an OPG is imported or restored, the vendor and model of the OPG file must match that of the target appliance. You can use opgtool to modify the headers as well as the contents of the tarball.
Note: opgtool may be installed and run Linux or Unix-like system that provides GNU tar. Note that Mac OS X provides BSD tar by default, which is incompatible and will result in corrupt configuration that will be rejected by the target appliance.
Alternatively if it's more convenient, you may install and run opgtool on an auxiliary Opengear appliance. In this scenario we recommend using /tmp as your working directory (cd /tmp) to prevent local configuration from being accidentally overwritten.
Please run opgtool with root privileges (e.g using sudo) in order to preserve file ownership.
Below is a worked example by way of demonstration, for full usage run opgtool with no arguments.
user@linuxbox:~ $ sudo -s
# bash opgtool
opgtool version 1.0
Usage: opgtool <-q|-u|-c /path/to/root|-x> <-f filename.opg> [-s Vendor/Model/x.y.z]
-q Query versioning
-u Update versioning, requires -s
-c Create OPG from /path/to/root, requires -s or existing filename.opg
-x Extract OPG contents to /home/user
-s Use Vendor/Model/x.y.z as versioning
-f OPG filename, required
# bash opgtool -x -f /path/to/config_backup.opg
[ snip ]
# vi etc/config/config.xml
[ make your changes ]
# bash opgtool -c . -f /path/to/config_backup.opg
Using versioning from existing OPG: OpenGear/IM72xx/3.15.1