diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2009-04-20 01:42:05 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2009-04-20 01:42:05 -0700 |
commit | 44f1651692a91c1f644bcae217a19d40c5bc9b65 (patch) | |
tree | 508853df82e21bbc0846b3d526d0ad6203ec6c75 | |
parent | 14b455b5e31feb7493d8545afb424b6f3e668c69 (diff) | |
download | vyatta-cfg-44f1651692a91c1f644bcae217a19d40c5bc9b65.tar.gz vyatta-cfg-44f1651692a91c1f644bcae217a19d40c5bc9b65.zip |
add env override for default session id
-rwxr-xr-x | scripts/vyatta-cfg-cmd-wrapper | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper index 8eddd5c..e994742 100755 --- a/scripts/vyatta-cfg-cmd-wrapper +++ b/scripts/vyatta-cfg-cmd-wrapper @@ -35,9 +35,16 @@ export VYATTA_EDIT_LEVEL=/; export VYATTA_TEMPLATE_LEVEL=/; export VYATTA_ACTIVE_CONFIGURATION_DIR=/opt/vyatta/config/active; -export VYATTA_CHANGES_ONLY_DIR=/tmp/changes_only_$PPID; -export VYATTA_TEMP_CONFIG_DIR=/opt/vyatta/config/tmp/new_config_$PPID; -export VYATTA_CONFIG_TMP=/opt/vyatta/config/tmp/tmp_$PPID; +# allow env variable to override default session id (ppid). this enables +# the script to handle cases where the invocations can come from +# different parents. +SID=$PPID +if [ -n "$CMD_WRAPPER_SESSION_ID" ]; then + SID=$CMD_WRAPPER_SESSION_ID +fi +export VYATTA_CHANGES_ONLY_DIR=/tmp/changes_only_$SID; +export VYATTA_TEMP_CONFIG_DIR=/opt/vyatta/config/tmp/new_config_$SID; +export VYATTA_CONFIG_TMP=/opt/vyatta/config/tmp/tmp_$SID; RET_STATUS=0 |