Use the export subcommand to save an ENM configuration. Exporting an ENM can be useful if you are responsible for maintaining multiple servers that require identical network configurations. You can use the export subcommand either interactively or in command-line mode. When an ENM is exported, the output is displayed as a series of subcommands that the netcfg command is capable of interpreting. These subcommands are similar to commands that you can type in the interactive or command-line mode.
The syntax for the export subcommand is as follows:
netcfg> export [ -d ] [ -f output-file ] [ enm-name ]
The following example shows how to display an ENM configuration on-screen by using the export subcommand interactively.
$ netcfg netcfg> export create "myenm" set activation-mode=manual set start="/path/to/start-script" end create "myenm" set activation-mode=conditional-all set conditions="advertised-domain is example.com" set fmri="svc:/application/test-enm:default" end
Using command-line mode, you can type the following command:
$ netcfg export
You can use the –d option with the export subcommand to add the destroy –a command as the first line of the netcfg export output, as shown in the following example, which has been truncated.
$ netcfg> export -d destroy -a create "myenm" set activation-mode=manual set start="/path/to/start-script" ...
In command-line mode, you can type the following command:
$ netcfg export -dExample 19 Exporting an ENM Configuration to a File
In the following examples, the configuration information for the test-enm ENM is written to a file by using the export subcommand with the –f option. The –f option writes the output to a new file named myconf, while the –d option adds the destroy –a command as the first line of the netcfg export output.
You can export the profile configuration to a file interactively as follows:
$ netcfg netcfg> export -d -f myconf
You can perform the same task in command-line mode as follows:
$ netcfg export -d -f myconf
The following truncated example shows how to display the profile configuration:
$ cat myconf destroy -a create "test-enm" . . .