From 2ffd41bc39e74d49e4e6d3d135c7a94dc1ebc43d Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 23 Nov 2010 15:38:40 -0800 Subject: Add COMMIT_VIA environment variable. --- etc/bash_completion.d/20vyatta-cfg | 2 ++ scripts/vyatta-cfg-cmd-wrapper | 2 ++ 2 files changed, 4 insertions(+) diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index d7b849c..110b563 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -115,9 +115,11 @@ commit () done args+=("-C '$comment'") + export COMMIT_VIA=cli if /opt/vyatta/sbin/my_commit "${args[@]}"; then vyatta_cli_shell_api markSessionUnsaved fi + unset COMMIT_VIA } commit-confirm () diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper index aa6bf01..569b68f 100755 --- a/scripts/vyatta-cfg-cmd-wrapper +++ b/scripts/vyatta-cfg-cmd-wrapper @@ -79,11 +79,13 @@ case "$1" in RET_STATUS=$? ;; commit) + export COMMIT_VIA=cfg-cmd-wrapper # debug file /tmp/bar should be deleted before release /opt/vyatta/sbin/my_commit -a >> /tmp/bar /opt/vyatta/sbin/my_commit -s >> /tmp/bar /opt/vyatta/sbin/my_commit -e -d >> /tmp/bar RET_STATUS=$? + unset COMMIT_VIA ;; commit_with_error) /opt/vyatta/sbin/my_commit -- cgit v1.2.3