e-smith-domains/createlinks

68 lines
3.0 KiB
Perl
Executable File

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("domains", $panel);
#--------------------------------------------------
# actions for domain-create event
#--------------------------------------------------
$event = "domain-create";
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/tinydns");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache.forwarder");
templates2events("/var/service/dnscache/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/config", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for domain-delete event
#--------------------------------------------------
$event = "domain-delete";
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/tinydns");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache.forwarder");
templates2events("/var/service/dnscache/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/config", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for domain-modify event
#--------------------------------------------------
$event = "domain-modify";
templates2events("/home/e-smith/ssl.pem/pem", $event);
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/tinydns");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache.forwarder");
templates2events("/var/service/dnscache/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/config", $event);
#--------------------------------------------------
# actions for e-smith-domains-update event
#--------------------------------------------------
$event = "e-smith-domains-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/tinydns");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dnscache.forwarder");
templates2events("/var/service/dnscache/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/root/servers/@", $event);
templates2events("/var/service/dnscache.forwarder/config", $event);