doraemon/root/etc/e-smith/events/actions/doraemon-migrate
Paolo Asperti b1502803ff small fixes
stupid vault


typo e vaultpass permission via sudo


added ui


only 'remote' hosts


sdasfdfsda


boh


test specfile
2016-07-22 18:38:13 +02:00

57 lines
1.7 KiB
Perl
Executable File

#!/usr/bin/perl
#
# Copyright (C) 2013 Nethesis S.r.l.
# http://www.nethesis.it - support@nethesis.it
#
# This script is part of NethServer.
#
# NethServer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# NethServer 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.
#
# You should have received a copy of the GNU General Public License
# along with NethServer. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: manage migration
use esmith::DB::db;
use esmith::event;
use strict;
my $event = shift;
my $sourceDir = shift;
my $esmithDbDir = '/home/e-smith/db';
my $errors = 0;
if( ! -d $sourceDir) {
die("Could not find dir $sourceDir");
}
my $srcConfigDb = esmith::DB::db->open_ro(join('', $sourceDir, $esmithDbDir, '/configuration')) || die("Could not open source configuration database in $sourceDir \n");
my $dstConfigDb = esmith::DB::db->open('configuration') || die("Could not open destination account db\n");
my $service = 'httpd-admin';
my $old = $srcConfigDb->get($service);
my $new = $dstConfigDb->get($service) || $dstConfigDb->new_record($service);
$new->set_prop('ValidFrom', $old->prop('ValidFrom') || '');
$old = $srcConfigDb->get('modSSL');
$new->set_prop('SSLCipherSuite', $old->prop('CipherSuite') || 'ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM');
#
# Apply configuration
#
if( ! esmith::event::event_signal('nethserver-httpd-admin-update')) {
exit(1);
}
exit 0;