Skip to content

Commit

Permalink
add reload alias for reboot command
Browse files Browse the repository at this point in the history
reload is a common  command used to restart routers / switches added a reload alisas and updated the manual to improve the help for the reboot command 

reload is added to the list that does not get listed in help / ambiguous  checks 
trivial Change ...
  • Loading branch information
smytht authored Oct 28, 2024
1 parent 172f4d2 commit 5aabeb5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,7 @@ size_t cmdtab_nitems = nitems(cmdtab);
*/

static Command cmdtab2[] = {
{ "reload", nreboothelp, CMPL0 0, 0, nreboot, 1, 0, 0, 0 },
{ "su", enablehelp, CMPL(ta) (char **)enabletab, sizeof(Menu), enable, 0, 0, 0, 0 },
{ 0, 0, CMPL0 0, 0, 0, 0, 0, 0, 0 }
};
Expand Down
36 changes: 34 additions & 2 deletions nsh.8
Original file line number Diff line number Diff line change
Expand Up @@ -1859,18 +1859,50 @@ Sep 8 15:05:37 tobsd tom: interface drops due to unprotected devices
.El
.Pp
.Tg reboot
.Tg restart
.Tg reload
.Ic reboot
.Pp
Restart the system.
Requires
.Nm while processing the command will warn the user if there are
unsaved changes to the running-config.
The user will be prompted to confirm the reboot in any case.
The command requires
.Nm
to be in privileged mode and requires root user privileges.
.Bl -dash
.It
E.g. restart the system
.Bd -literal -offset indent
nsh(config-p)/reboot
% Reboot initiated
% WARNING: The running configuration contains unsaved changes!
% The 'show diff-config' command will display unsaved changes.
% The 'write-config' command will save changes to /etc/nshrc.
Proceed with reboot? [yes/no]
.Ed
.El
.Pp
.Tg reboot
.Tg restart
.Tg reload
.Ic reload
.Pp
an alias for the reboot command above.
.Nm while processing the command will warn the user if there are
unsaved changes to the running-config.
The user will be prompted to confirm the reboot in any case.
The command requires
.Nm
to be in privileged mode and requires root user privileges.
.Bl -dash
.It
E.g. restart the system
.Bd -literal -offset indent
nsh(config-p)/reload
% WARNING: The running configuration contains unsaved changes!
% The 'show diff-config' command will display unsaved changes.
% The 'write-config' command will save changes to /etc/nshrc.
Proceed with reboot? [yes/no]
.Ed
.El
.Pp
Expand Down

0 comments on commit 5aabeb5

Please sign in to comment.