Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / templates / simplerule.epp @ 3a52fb41

Historique | Voir | Annoter | Télécharger (588 octets)

1
<%- | String                  $action,
2
      Optional[String]        $comment,
3
      Optional[Variant[Array[Stdlib::Port, 1], Stdlib::Port, String]] $dport,
4
      Optional[String]        $proto,
5
| -%>
6
<%- if $proto and $dport {
7
  if $dport =~ Array {
8
    $_destination = "${proto} dport {${dport.join(', ')}}"
9
  } else {
10
    $_destination = "${proto} dport $dport"
11
  }
12
} else {
13
  $_destination = undef
14
} -%>
15
<%- if $comment {
16
  $_comment = "comment \"${comment}\""
17
} else {
18
  $_comment = undef
19
} -%>
20
<%= regsubst(strip([$_destination, $_comment, $action].join(' ')), '\s+', ' ', 'G') -%>