e-smith-packetfilter/createlinks

47 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
templates2events("/etc/ulogd.conf", qw(post-install post-upgrade e-smith-packetfilter-update));
# conf-masq
templates2events("/etc/rc.d/init.d/masq", qw(
console-save
bootstrap-console-save
network-create
network-delete
remoteaccess-update
email-update
e-smith-packetfilter-update
));
foreach (qw(console-save ip-change network-create network-delete remoteaccess-update e-smith-packetfilter-update))
{
safe_symlink("reload", "root/etc/e-smith/events/$_/services2adjust/masq");
}
my $event ="e-smith-packetfilter-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ulogd");
event_link("systemd-reload", $event, "89");
event_link("systemd-default", $event, "88");
templates2events("/etc/logrotate.d/ulogd", ($event,qw(post-install post-upgrade bootstrap-console-save)) );
#systemd
foreach my $target (qw(multi-user sme-server))
{
system('mkdir -p root/usr/lib/systemd/system/'.$target.'.target.wants/');
foreach my $unit (qw(
masq.service
ulogd.service
))
{
symlink("../$unit",
"root/usr/lib/systemd/system/$target.target.wants/$unit")
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/$unit: $!";
}
}