summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@io.vyatta.com>2009-02-06 12:06:32 -0800
committerStig Thormodsrud <stig@io.vyatta.com>2009-02-06 12:06:32 -0800
commitc6d4234272d0d5c384678bf08be6324ed78f3268 (patch)
tree6b3f277f43d27be009b3a4c82af414c0261ed800
parent8095ae0fb4c4d62e6d0c793e851f4133fcf4849a (diff)
parente7d21491fb51d5b1e36fb19c0b2afff735c1bae6 (diff)
downloadvyatta-cfg-c6d4234272d0d5c384678bf08be6324ed78f3268.tar.gz
vyatta-cfg-c6d4234272d0d5c384678bf08be6324ed78f3268.zip
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg into jenner
-rw-r--r--debian/changelog6
-rwxr-xr-xscripts/vyatta-cfg-reload59
2 files changed, 65 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index e01c2d6..41a8ffb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+vyatta-cfg (0.14.11) unstable; urgency=low
+
+ * Move config reload from quagga to vyatta-cfg
+
+ -- Stephen Hemminger <stephen.hemminger@vyatta.com> Thu, 05 Feb 2009 14:47:22 -0800
+
vyatta-cfg (0.14.10) unstable; urgency=low
* Vyatta::Config - parseTmpl convert to 3 arg open
diff --git a/scripts/vyatta-cfg-reload b/scripts/vyatta-cfg-reload
new file mode 100755
index 0000000..bf8f5e7
--- /dev/null
+++ b/scripts/vyatta-cfg-reload
@@ -0,0 +1,59 @@
+#! /bin/bash
+# Author: Stephen Hemminger
+# Date: 2009
+# Description: reload portion of configurateion
+
+# **** License ****
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# This code was originally developed by Vyatta, Inc.
+# Portions created by Vyatta are Copyright (C) 2006, 2007, 2008 Vyatta, Inc.
+# All Rights Reserved.
+# **** End License ****
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 config path ..."
+ exit 1
+fi
+
+if [ $EUID -ne 0 ]; then
+ echo "Must be root"
+ exit 1
+fi
+
+T=$IFS; IFS="/"
+path=/opt/vyatta/config/active/protocols/"$*"
+IFS=$T
+
+# No point in reloading if that portion of config doesn't exist
+if [ ! -d $path ]; then
+ echo "$path does not exist"
+ exit 1
+fi
+
+# Begin reloading transaction
+/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/${daemon}-restart.$$
+/opt/vyatta/sbin/vyatta-save-config.pl $tmp || exit 1
+
+# Erase portion of active configuration for that protocol
+rm -fr $path
+
+# Reload causing configuration to activate - implies commit
+/opt/vyatta/sbin/vyatta-load-config.pl $tmp || exit 1
+
+# remove tmp file if successful
+rm $tmp
+