diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-05 11:17:02 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-05 11:17:02 -0800 |
commit | ca234139fa6b8ce95c144e422973fd5346e02c14 (patch) | |
tree | ba009c6231bb81ddcd71669263c2ed418d458a27 | |
parent | 7047feb74cec411ce51d00a87005ee284cb51fe8 (diff) | |
download | vyatta-cfg-quagga-ca234139fa6b8ce95c144e422973fd5346e02c14.tar.gz vyatta-cfg-quagga-ca234139fa6b8ce95c144e422973fd5346e02c14.zip |
Fix reload
If setting up transaction fails, then fail the reload
Use correct tmp file, and remove if successful.
-rwxr-xr-x | scripts/vyatta-protocol | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/vyatta-protocol b/scripts/vyatta-protocol index e8fff484..4ff0c941 100755 --- a/scripts/vyatta-protocol +++ b/scripts/vyatta-protocol @@ -49,20 +49,24 @@ case "$1" in reload) # Start new transaction - /opt/vyatta/sbin/vyatta-cfg-cmd-wrapper begin + /opt/vyatta/sbin/vyatta-cfg-cmd-wrapper begin || exit 1 # In case of error undo trap "/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper end" EXIT HUP INT QUIT TERM # Save current configuration tmp=/tmp/${protocol}-restart.$$ - /opt/vyatta/sbin/vyatta-save-config.pl $tmp + /opt/vyatta/sbin/vyatta-save-config.pl $tmp || exit 1 # Erase active configuration for that protocol rm -fr /opt/vyatta/config/active/protocols/$protocol # Reload causing configuration to activate - implies commit - /opt/vyatta/sbin/vyatta-load-config.pl $TMP + # remove tmp file if successful + /opt/vyatta/sbin/vyatta-load-config.pl $tmp || exit 1 + + rm $tmp + ;; *) usage;; |