Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.63 KB | None | 0 0
  1. package Listener::Named::CustomTemplates;
  2.  
  3. #
  4. ## Listener which override i-MSCP files by copying your own files
  5. ## when the afterBuild event is triggered
  6. #
  7.  
  8. use iMSCP::EventManager;
  9. use iMSCP::Dir;
  10.  
  11. #
  12. ## Configuration variables
  13. #
  14.  
  15. my $srcDir = '/root/imscp/custom/templates/bind/parts';
  16. my $targetDir = '/etc/imscp/bind/parts';
  17.  
  18. #
  19. ## Please, don't edit anything below this line
  20. #
  21.  
  22. sub copyTemplates
  23. {
  24.     if(-d $srcDir) {
  25.         iMSCP::Dir->new( dirname => $srcDir )->rcopy( "$main::{'INST_PREF'}$targetDir" );
  26.     } else {
  27.         0;
  28.     }
  29. }
  30.  
  31. iMSCP::EventManager->getInstance()->register('afterBuild', \&copyTemplates);
  32.  
  33. 1;
  34. __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement