Skip to content

Commit

Permalink
T5249: Add node rollback-soft
Browse files Browse the repository at this point in the history
```
vyos@r4# rollback-soft
Possible completions:
  <N>	Rollback to revision N
```
  • Loading branch information
sever-sever committed Dec 11, 2023
1 parent f86d305 commit bd20df1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions functions/interpreter/vyatta-cfg-run
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ _vyatta_cfg_cmds=( "confirm" \
"merge" \
"rename" \
"rollback" \
"rollback-soft" \
"run" \
"save" \
"set" \
Expand All @@ -56,6 +57,7 @@ _vyatta_cfg_helps=( \
"Load configuration from a file and merge running configuration" \
"Rename a configuration element" \
"Rollback to a prior config revision (requires reboot)" \
"Rollback to a prior config revision (without reboot)" \
"Run an operational-mode command" \
"Save configuration to a file" \
"Set the value of a parameter or create a new element" \
Expand Down Expand Up @@ -212,6 +214,15 @@ vyatta_config_rollback ()
sudo ${vyos_bin_dir}/config-mgmt rollback --rev "$@"
}

vyatta_config_rollback-soft ()
{
if [ $# != 1 ]; then
echo "Error: must include a revision # to rollback to"
return 1;
fi
sudo ${vyos_bin_dir}/config-mgmt rollback_soft --rev "$@"
}

shutdown ()
{
echo "Exit from configure mode before shutting down system."
Expand Down Expand Up @@ -565,6 +576,7 @@ vyatta_cfg_run ()
commit) vyatta_config_commit "${@:2}";;
confirm) vyatta_config_confirm "${@:2}";;
rollback) vyatta_config_rollback "${@:2}";;
rollback-soft) vyatta_config_rollback-soft "${@:2}";;
commit-confirm) vyatta_config_commit-confirm "${@:2}";;
compare) vyatta_config_compare "${@:2}";;
save) vyatta_config_save "${@:2}" ;;
Expand Down Expand Up @@ -614,6 +626,8 @@ _vyatta_cfg_init ()
complete -F vyatta_compare_complete ${cmd:0:$pos} ;;
rollback)
complete -F vyatta_rollback_complete ${cmd:0:$pos} ;;
rollback-soft)
complete -F vyatta_rollback_complete ${cmd:0:$pos} ;;
commit|commit-confirm)
complete -F vyatta_commit_complete ${cmd:0:$pos} ;;
*)
Expand Down

0 comments on commit bd20df1

Please sign in to comment.