diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-12-09 15:37:58 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-12-11 18:35:32 +0000 |
commit | 6ddafd315aade19f62903c5b749309e54e872ea9 (patch) | |
tree | d22e460d94ab058afc90fed1e643dcabb69df6f0 | |
parent | f86d305d2cd638e70e64ef912d826aa1c448c29b (diff) | |
download | vyatta-cfg-6ddafd315aade19f62903c5b749309e54e872ea9.tar.gz vyatta-cfg-6ddafd315aade19f62903c5b749309e54e872ea9.zip |
T5249: Add node rollback-soft
```
vyos@r4# rollback-soft
Possible completions:
<N> Rollback to revision N
```
-rw-r--r-- | functions/interpreter/vyatta-cfg-run | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/functions/interpreter/vyatta-cfg-run b/functions/interpreter/vyatta-cfg-run index 50d6071..a13c62d 100644 --- a/functions/interpreter/vyatta-cfg-run +++ b/functions/interpreter/vyatta-cfg-run @@ -37,6 +37,7 @@ _vyatta_cfg_cmds=( "confirm" \ "merge" \ "rename" \ "rollback" \ + "rollback-soft" \ "run" \ "save" \ "set" \ @@ -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" \ @@ -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 + ${vyos_bin_dir}/config-mgmt rollback_soft --rev "$@" +} + shutdown () { echo "Exit from configure mode before shutting down system." @@ -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}" ;; @@ -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} ;; *) |