Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Text::ASCIITable;
- use Getopt::Std;
- use Config::General;
- #my $CONF2SOGO_CONFIGURATION_FILE = "./SOGo.conf";
- #####################################################################
- #
- # Configuration loading stage.
- #
- #####################################################################
- my $configuration = new Config::General("SOGo.conf");
- my %conf = $configuration->getall;
- #####################################################################
- #
- # Grab all the "flat" variables (variables not inside a hash)
- #
- #####################################################################
- foreach my $k ( keys %conf )
- {
- # For each key found, we do an individual 'defaults write key value'
- if(ref $conf{$k} eq 'HASH')
- {
- # ignore...
- }
- else
- {
- print "defaults write sogod $k $conf{$k}\n";
- #system("defaults write sogod $k $conf{$k}");
- }
- }
- my $SOGoUserSources = $conf{SOGoUserSources};
- my @sources;
- for my $k ( keys %$SOGoUserSources )
- {
- if( ref $SOGoUserSources->{$k} eq 'HASH')
- {
- my $source = $SOGoUserSources->{$k};
- push @sources, join ";", map { "$_=$source->{$_}" } keys %$source;
- }
- }
- my $str = join ",", map { "{$_}" } @sources;
- print "\ndefaults write sogod SOGoUserSources '($str)'\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement