12345678910111213141516171819202122232425 |
- #!/usr/bin/perl
- use strict;
- use Template;
- my $lacg_dir = "/root/lacg";
- my $lacg_conf = sprintf('%s/%s', ($lacg_dir,"config"));
- my $lacg_templates_dir = sprintf('%s/%s', ($lacg_dir, "templates"));
- our %templates;
- our %data;
- require $lacg_conf;
- foreach my $template (keys %templates)
- {
- printf "Writing %s\n", $templates{$template};
- my $tt = Template->new({ABSOLUTE => 1});
- my $tt_file = sprintf('%s/%s', ($lacg_templates_dir, $template));
- $tt->process($tt_file, \%data, $templates{$template}) || die $tt->error;
- }
- print "Lazy Admin Configuration Generator is done.\n";
- print "Press enter to reboot...\n";
- <>;
- exec('reboot');
|