forked from NethServer/nethserver-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatelinks
More file actions
executable file
·242 lines (200 loc) · 6.27 KB
/
createlinks
File metadata and controls
executable file
·242 lines (200 loc) · 6.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#!/usr/bin/perl -w
#
# Copyright (C) 2012 Nethesis S.r.l.
# http://www.nethesis.it - support@nethesis.it
#
# This script is part of NethServer.
#
# NethServer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# NethServer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NethServer. If not, see <http://www.gnu.org/licenses/>.
#
use esmith::Build::CreateLinks qw(:all);
use File::Path;
event_actions('trusted-networks-modify', qw(
legacy-call-network-create 10
firewall-adjust 94
));
#--------------------------------------------------
# actions for nethserver-base-update event
#--------------------------------------------------
event_actions('nethserver-base-update', qw(
initialize-default-databases 00
nethserver-base-selinux-setup 10
remount-filesystems 10
nethserver-base-conf 40
nethserver-base-pam-setup 50
nethserver-base-mail-aliases 50
));
event_templates('nethserver-base-update', qw(
/etc/hosts
/etc/fstab
/etc/resolv.conf
/etc/selinux/config
/etc/pam.d/system-auth-nh
/etc/pam.d/password-auth-nh
/etc/sudoers
/etc/shells
/etc/rc.d/rc.local
/etc/krb5.conf
/etc/logviewer.conf
/etc/logrotate.conf
));
#
# Template headers
#
safe_symlink(
"/etc/e-smith/templates-default/template-begin-pam",
"root/etc/e-smith/templates/etc/pam.d/system-auth-nh/template-begin");
safe_symlink(
"/etc/e-smith/templates-default/template-begin-shell",
"root/etc/e-smith/templates/etc/rc.d/rc.local/template-begin");
#--------------------------------------------------
# actions for interface-modify event #1532
#--------------------------------------------------
event_actions('interface-update', qw(
network-stop 04
interface-config-reset 25
interface-config-write 30
reset-udev-rules 35
network-start 70
interface-config-hostname 75
static-routes-save 80
firewall-adjust 90
trusted-networks-modify 95
));
event_templates('interface-update', qw(
/etc/modprobe.d/bonding.conf
/etc/sysconfig/network
/etc/hosts
/etc/resolv.conf
));
#--------------------------------------------------
# Refs #939 tcp/udp port server validator
#--------------------------------------------------
validator_actions('remote-port', qw(
open-tcp-connection 10
));
#--------------------------------------------------
# Refs #1038 expand /etc/hosts template on host
# events -- FIXME: should be moved into
# nethserver-hosts package (?)
#--------------------------------------------------
templates2events('/etc/hosts', qw(
host-create
host-delete
host-modify
));
#--------------------------------------------------
# empty events:
#--------------------------------------------------
foreach (qw(
)) {
File::Path::make_path('root/etc/e-smith/events/' . $_);
}
#--------------------------------------------------
# actions for system-init event
#--------------------------------------------------
event_actions('system-init', qw(
initialize-default-databases 00
nethserver-base-initialize-db 50
nethserver-generate-certificate 55
init-repo 60
system-adjust 90
nethserver-base-interface-update 95
));
#
# certificate-update event
#
event_actions('certificate-update', qw(
nethserver-generate-certificate 02
));
#
# profile-modify event
#
event_actions('profile-modify', qw(
nethserver-base-mail-aliases 30
));
event_services('profile-modify', qw(
postfix reload
));
#
# fstab-update
#
$event = "fstab-update";
event_actions($event, 'remount-filesystems' => 20);
templates2events('/etc/fstab', $event);
#--------------------------------------------------
# actions for migration-import event
#--------------------------------------------------
$event = "migration-import";
event_actions($event, 'nethserver-base-migrate' => 20);
#--------------------------------------------------
# actions for firewall-adjust event
#--------------------------------------------------
$event = "firewall-adjust";
event_actions($event, 'firewall-adjust' => 20);
#--------------------------------------------------
# actions for runlevel-adjust event
#--------------------------------------------------
$event = "runlevel-adjust";
event_actions($event, 'runlevel-adjust' => 20);
#
# hostname-modify event (#1878)
#
event_templates('hostname-modify', qw(
/etc/sysconfig/network
));
event_actions('hostname-modify', qw(
interface-config-hostname 02
system-adjust 96
));
#
# Validator for log file names (#470)
#
validator_actions('logfile', qw(
logfile 10
));
#
# Validator for network configuration consistency (#2103)
#
validator_actions('interface-config', qw(
interface-role 10
));
#--------------------------------------------------
# password-modify event
#--------------------------------------------------
event_actions('password-modify', qw(
password-set 25
password-cleanup 90
));
#--------------------------------------------------
# validate passwords
#--------------------------------------------------
validator_actions('password-strength',
'password-strength' => '10');
#--------------------------------------------------
# actions for static-routes-save event
#--------------------------------------------------
$event = "static-routes-save";
event_actions($event, qw(
network-route-down 15
interface-config-write 25
network-route-up 35
));
#--------------------------------------------------
# Refs #3272 uniq key networks db validator
#--------------------------------------------------
validator_actions('network-create', qw(
uniq-networksdb-key 20
));
exit 0;