diff options
author | Deepti Kulkarni <deepti@vyatta.com> | 2012-02-22 08:37:53 -0800 |
---|---|---|
committer | Deepti Kulkarni <deepti@vyatta.com> | 2012-02-22 08:37:53 -0800 |
commit | ead984061d0fef9de47cde118ddab40ff73c0fa8 (patch) | |
tree | 3b75e09895f57a45a28cc4a001d3681c7b440454 | |
parent | ab725a781134de29ff7ec668ab4b608ae3f31bfb (diff) | |
download | vyatta-cfg-ead984061d0fef9de47cde118ddab40ff73c0fa8.tar.gz vyatta-cfg-ead984061d0fef9de47cde118ddab40ff73c0fa8.zip |
Bug fix for 4718 - Log successful commits in messages file.
-rw-r--r-- | functions/interpreter/vyatta-cfg-run | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/functions/interpreter/vyatta-cfg-run b/functions/interpreter/vyatta-cfg-run index 7558ffa..3586ea9 100644 --- a/functions/interpreter/vyatta-cfg-run +++ b/functions/interpreter/vyatta-cfg-run @@ -101,6 +101,9 @@ vyatta_config_show () | eval "${VYATTA_PAGER:-cat}" } +declare cur_tty=$(ps -o tty= |head -n1) +declare cur_user=$(id -un) + vyatta_config_commit () { if ! vyatta_cli_shell_api sessionChanged; then @@ -127,6 +130,12 @@ vyatta_config_commit () export COMMIT_COMMENT="$comment" export COMMIT_VIA=cli /opt/vyatta/sbin/my_commit "${args[@]}" 2>&1 + local ret_value=$? + + if [ "$ret_value" == "0" ]; then + logger -p warning -t commit "Active configuration has been changed by user\ + '$cur_user' on '$cur_tty'" + fi unset COMMIT_VIA unset COMMIT_COMMENT } |