summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-protocol10
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;;