smeserver-libreswan/createlinks

69 lines
1.8 KiB
Perl

#! /usr/bin/perl -w
# Need some thought on when the templates should be expanded and when the action should be called.
use esmith::Build::CreateLinks qw(:all);
# our event specific for updating with yum without reboot
$event = "smeserver-libreswan-update";
#add here the path to your templates needed to expand
#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
foreach my $file (qw(
/etc/systemd/system-preset/49-koozali.preset
/etc/ipsec.conf
/etc/ipsec.secrets
/etc/ipsec.d/ipsec.conf
/etc/ipsec.d/ipsec.secrets
/etc/rc.d/init.d/masq
/etc/sysctl.conf
))
{
templates2events($file, qw(
smeserver-libreswan-update
post-upgrade
console-save
bootstrap-console-save
remoteaccess-update
));
}
#action needed in case we have a systemd unit
event_link("systemd-default", $event, "10");
event_link("systemd-reload", $event, "50");
#action specific to this package
foreach my $event_link (qw (
smeserver-libreswan-update
remoteaccess-update
console-save
))
{
event_link("ipsec-update", $event_link, "60");
}
#services we need to restart
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ipsec");
safe_symlink("adjust", "root/etc/e-smith/events/$event/services2adjust/masq");
# Set up generic logfile timestamp renaming/symlinking
foreach (qw(
/var/log/pluto/pluto.log
))
{
safe_touch "root/etc/e-smith/events/logrotate/logfiles2timestamp/$_";
}
#--------------------------------------------------
# actions for logrotate event
#--------------------------------------------------
$event = "logrotate";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ipsec");