<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15609">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: Optionally Set/replace cfg file during cmd 'write file'<br><br>This way if the process is started with no file associated (eg. no -c<br>param and default cfg path doesn't exist), config can be later saved<br>into a file by passing the parameter. Otherwise, until now this message<br>was displayed:<br>Can't save to configuration file, using vtysh.<br><br>Related: OS#4024<br>Change-Id: I38edcf902a08b6bd0ebb9aa6fc1a7041421af525<br>---<br>M src/vty/command.c<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/15609/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/vty/command.c b/src/vty/command.c</span><br><span>index 35169eb..0d24b66 100644</span><br><span>--- a/src/vty/command.c</span><br><span>+++ b/src/vty/command.c</span><br><span>@@ -2927,9 +2927,10 @@</span><br><span> /* Write current configuration into file. */</span><br><span> DEFUN(config_write_file,</span><br><span>       config_write_file_cmd,</span><br><span style="color: hsl(0, 100%, 40%);">-      "write file",</span><br><span style="color: hsl(120, 100%, 40%);">+      "write file [PATH]",</span><br><span>       "Write running configuration to memory, network, or terminal\n"</span><br><span style="color: hsl(0, 100%, 40%);">-      "Write to configuration file\n")</span><br><span style="color: hsl(120, 100%, 40%);">+      "Write to configuration file\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "Set file path to store the config, or replace if already exists\n")</span><br><span> {</span><br><span>    char *failed_file;</span><br><span>   int rc;</span><br><span>@@ -2943,6 +2944,9 @@</span><br><span>              }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (argc == 1)</span><br><span style="color: hsl(120, 100%, 40%);">+                host_config_set(argv[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (host.config == NULL) {</span><br><span>           vty_out(vty, "Can't save to configuration file, using vtysh.%s",</span><br><span>                       VTY_NEWLINE);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15609">change 15609</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/15609"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I38edcf902a08b6bd0ebb9aa6fc1a7041421af525 </div>
<div style="display:none"> Gerrit-Change-Number: 15609 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>