summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-load-config.pl6
-rwxr-xr-xscripts/vyatta-save-config.pl9
-rwxr-xr-xscripts/xorp_tmpl_tool14
3 files changed, 15 insertions, 14 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index a6f037a..d011a65 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -8,11 +8,7 @@ use VyattaConfigLoad;
my $etcdir = $ENV{vyatta_sysconfdir};
my $sbindir = $ENV{vyatta_sbindir};
-my $bootpath = '';
-if (-r "$etcdir/bootfile_path") {
- $bootpath = `cat $etcdir/bootfile_path`;
-}
-$bootpath =~ s/\/[^\/]+$//;
+my $bootpath = $etcdir . "/config";
if ($#ARGV != 0) {
print "Usage: load <config_file_name>\n";
diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl
index 26b8eec..bad7c45 100755
--- a/scripts/vyatta-save-config.pl
+++ b/scripts/vyatta-save-config.pl
@@ -5,19 +5,14 @@ use lib "/opt/vyatta/share/perl5/";
use VyattaConfigOutput;
my $etcdir = "/opt/vyatta/etc";
-my $bootfile = '';
-if (-r "$etcdir/bootfile_path") {
- $bootfile = `cat $etcdir/bootfile_path`;
-}
-my $bootpath = $bootfile;
-$bootpath =~ s/\/[^\/]+$//;
+my $bootpath = $etcdir . "/config";
+my $save_file = $bootpath . "/config.boot";
if ($#ARGV > 0) {
print "Usage: save [config_file_name]\n";
exit 1;
}
-my $save_file = "$bootfile";
if (defined($ARGV[0])) {
$save_file = $ARGV[0];
if (!($save_file =~ /^\//)) {
diff --git a/scripts/xorp_tmpl_tool b/scripts/xorp_tmpl_tool
index 54c87bb..014a53b 100755
--- a/scripts/xorp_tmpl_tool
+++ b/scripts/xorp_tmpl_tool
@@ -1,5 +1,11 @@
#!/bin/bash
+if grep -q union=aufs /proc/cmdline || grep -q aufs /proc/filesystems ; then
+ export UNIONFS=aufs
+else
+ export UNIONFS=unionfs
+fi
+
UMASK_SAVE_G=`umask`
umask 0111
XORPLOGFILE=/tmp/xorp_tmpl_tool.log
@@ -36,7 +42,7 @@ export VYATTA_TEMP_CONFIG_DIR=/opt/vyatta/config/tmp/new_config_$VTID;
if [ ! -d $VYATTA_TEMP_CONFIG_DIR ]
then
mkdir -p $VYATTA_TEMP_CONFIG_DIR
- sudo mount -t unionfs -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro unionfs ${VYATTA_TEMP_CONFIG_DIR}
+ sudo mount -t $UNIONFS -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro $UNIONFS ${VYATTA_TEMP_CONFIG_DIR}
fi
## cli ENV_TMP_DIR
@@ -110,7 +116,7 @@ case "$1" in
sudo umount ${VYATTA_TEMP_CONFIG_DIR}
sudo rm -rf $VYATTA_CHANGES_ONLY_DIR/* $VYATTA_CHANGES_ONLY_DIR/.modified
- sudo mount -t unionfs -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro unionfs ${VYATTA_TEMP_CONFIG_DIR}
+ sudo mount -t $UNIONFS -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro $UNIONFS ${VYATTA_TEMP_CONFIG_DIR}
RET_STATUS=0
;;
end_loading)
@@ -150,3 +156,7 @@ echo "ret=${RET_STATUS}" >> ${XORPLOGFILE}
umask ${UMASK_SAVE_G}
exit $RET_STATUS
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 4
+# End: