diff options
author | ivan <ivan> | 2004-06-30 10:02:45 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-06-30 10:02:45 +0000 |
commit | 6e606e4f3c8a27df62bb2f229a09fccca7bd4d6b (patch) | |
tree | 83b0bc29c64e7227e801630bf05903d13c90cbe5 /FS/bin/freeside-daily | |
parent | 6dd9433a5401f1b21fa38e9372ed2aab2a5d26c2 (diff) |
add option to pgp/gpg encrypt scp dumps
Diffstat (limited to 'FS/bin/freeside-daily')
-rwxr-xr-x | FS/bin/freeside-daily | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 00de2987a..99d95d5d2 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -63,7 +63,6 @@ if ( driver_name eq 'Pg' ) { } } -#local hack my $conf = new FS::Conf; my $dest = $conf->config('dump-scpdest'); if ( $dest ) { @@ -75,7 +74,18 @@ if ( $dest ) { } else { die "database dumps not yet supported for ". driver_name; } - scp("/var/tmp/$database.sql", $dest); + if ( $conf->config('dump-pgpid') ) { + eval 'use GnuPG'; + my $gpg = new GnuPG; + $gpg->encrypt( plaintext => "/var/tmp/$database.sql", + output => "/var/tmp/$database.gpg", + recipient => $conf->config('dump-pgpid'), + ); + scp("/var/tmp/$database.gpg", $dest); + unlink "/var/tmp/$database.gpg" or die $!; + } else { + scp("/var/tmp/$database.sql", $dest); + } unlink "/var/tmp/$database.sql" or die $!; } |