Change in ...libosmocore[master]: vty: Optionally Set/replace cfg file during cmd 'write file'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 7 20:01:45 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/libosmocore/+/15609 )

Change subject: vty: Optionally Set/replace cfg file during cmd 'write file'
......................................................................

vty: Optionally Set/replace cfg file during cmd 'write file'

This way if the process is started with no file associated (eg. no -c
param and default cfg path doesn't exist), config can be later saved
into a file by passing the parameter. Otherwise, until now this message
was displayed:
Can't save to configuration file, using vtysh.

Related: OS#4024
Change-Id: I38edcf902a08b6bd0ebb9aa6fc1a7041421af525
---
M src/vty/command.c
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/command.c b/src/vty/command.c
index 35169eb..0d24b66 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2927,9 +2927,10 @@
 /* Write current configuration into file. */
 DEFUN(config_write_file,
       config_write_file_cmd,
-      "write file",
+      "write file [PATH]",
       "Write running configuration to memory, network, or terminal\n"
-      "Write to configuration file\n")
+      "Write to configuration file\n"
+      "Set file path to store the config, or replace if already exists\n")
 {
 	char *failed_file;
 	int rc;
@@ -2943,6 +2944,9 @@
 		}
 	}
 
+	if (argc == 1)
+		host_config_set(argv[0]);
+
 	if (host.config == NULL) {
 		vty_out(vty, "Can't save to configuration file, using vtysh.%s",
 			VTY_NEWLINE);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15609
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I38edcf902a08b6bd0ebb9aa6fc1a7041421af525
Gerrit-Change-Number: 15609
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191007/3e83ae5c/attachment.htm>


More information about the gerrit-log mailing list