diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2010-11-07 10:58:14 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2010-11-07 10:58:14 -0800 |
commit | e76f9de8dba8f17fc4949c9e93aa6a3a3960f4b2 (patch) | |
tree | 28b34f51c256784be6e7959bfa4315f12b76e4f1 /scripts/vyatta-commit-push.pl | |
parent | 884a8ebcf1f5d28b84a3b6430db9d331302e6338 (diff) | |
download | vyatta-config-mgmt-e76f9de8dba8f17fc4949c9e93aa6a3a3960f4b2.tar.gz vyatta-config-mgmt-e76f9de8dba8f17fc4949c9e93aa6a3a3960f4b2.zip |
Append hostname on config.boot file for commit-uri.
Diffstat (limited to 'scripts/vyatta-commit-push.pl')
-rwxr-xr-x | scripts/vyatta-commit-push.pl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/vyatta-commit-push.pl b/scripts/vyatta-commit-push.pl index c375f27..1105067 100755 --- a/scripts/vyatta-commit-push.pl +++ b/scripts/vyatta-commit-push.pl @@ -35,11 +35,11 @@ use lib '/opt/vyatta/share/perl5/'; use Vyatta::Config; use Vyatta::ConfigMgmt; use POSIX; -use File::Basename; use File::Compare; use File::Copy; use URI; use WWW::Curl::Easy; +use Sys::Hostname; my $debug = 0; @@ -54,7 +54,7 @@ if (scalar(@uris) < 1) { } my $last_push_file = cm_get_last_push_file(); -my $tmp_push_file = "/tmp/config.boot-push.$$"; +my $tmp_push_file = "/tmp/config.boot.$$"; my $cmd = 'cli-shell-api showCfg --show-active-only'; system("$cmd > $tmp_push_file"); @@ -63,8 +63,10 @@ if (-e $last_push_file and compare($last_push_file, $tmp_push_file) == 0) { exit 0; } -my $timestamp = strftime("_%Y%m%d_%H%M%S", localtime); -my $save_file = basename($tmp_push_file) . $timestamp; +my $timestamp = strftime(".%Y%m%d_%H%M%S", localtime); +my $hostname = hostname(); +$hostname = 'vyatta' if ! defined $hostname; +my $save_file = "config.boot-$hostname" . $timestamp; print "Archiving config...\n"; foreach my $uri (@uris) { |