repo.or.cz
/
omd.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'master' of mathias-kettner.de:omd
[omd.git]
/
packages
/
icinga
/
ssi-wrapper.pl
blob
5fa49ed21dee11a00d54b9f845c95c8b3afb5824
1
#!/usr/bin/perl
2
##
3
## Site speicific SSI wrapper
4
##
5
use
File
::
Basename
;
6
$ssi
=
basename
(
$0
);
7
@site
=
split
(
/\/
/,
$ENV
{
'SCRIPT_NAME'
});
8
$file
=
sprintf
(
"/opt/omd/sites/
%s
/etc/icinga/ssi/
%s
"
,
$site
[
1
],
$ssi
);
9
if
( -
x
$file
){
10
open
(
FH
,
'-|'
,
$file
);
11
while
(<
FH
>){
12
print
;
13
}
14
exit
0
;
15
}
16
if
( -
e
$file
){
17
open
(
FH
,
$file
);
18
while
(<
FH
>){
19
print
;
20
}
21
exit
0
;
22
}
23
exit
0
;