| 1 |
## -*- mode: shell-script; -*- |
| 2 |
## |
| 3 |
## To be able to make changes to the part of configuration created |
| 4 |
## from this configlet you need to copy this file to the directory |
| 5 |
## fwbuilder/configlets/linux24/ in your home directory and modify it. |
| 6 |
## Double "##" comments are removed during processing but single "#" |
| 7 |
## comments are be retained and appear in the generated script. Empty |
| 8 |
## lines are removed as well. |
| 9 |
## |
| 10 |
## Configlets support simple macro language with these constructs: |
| 11 |
## {{$var}} is variable expansion |
| 12 |
## {{if var}} is conditional operator. |
| 13 |
## |
| 14 |
## Known variables: |
| 15 |
## |
| 16 |
## need_iptables_restore |
| 17 |
## need_ip6tables_restore |
| 18 |
## need_modprobe : set to true if "load modules" option is on, or |
| 19 |
## script needs to manage vlan or bonding interfaces. |
| 20 |
## See configlets for vlan and bonding interfaces to find |
| 21 |
## how modprobe is used to load corresponding modules |
| 22 |
## need_vconfig : set to true if script manages vlans |
| 23 |
## need_brctl : set to true if script manages bridge ports |
| 24 |
## need_ifenslave : set to true if script manages bonding interfaces |
| 25 |
## need_ipset : set to true if ipset is used for run-time address tables |
| 26 |
## load_modules : set to true if "load modules" option is on |
| 27 |
## |
| 28 |
## These variables are set in OSConfigurator_linux24::printShellFunctions() |
| 29 |
## |
| 30 |
|
| 31 |
find_program() { |
| 32 |
PGM=$1 |
| 33 |
which $PGM >/dev/null 2>&1 || { |
| 34 |
echo "\"$PGM\" not found" |
| 35 |
exit 1 |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
check_tools() { |
| 40 |
find_program which |
| 41 |
find_program $IPTABLES |
| 42 |
{{if need_iptables_restore}} find_program $IPTABLES_RESTORE{{endif}} |
| 43 |
{{if need_ip6tables_restore}} find_program $IP6TABLES_RESTORE{{endif}} |
| 44 |
find_program $IP |
| 45 |
{{if need_vconfig}} find_program $VCONFIG {{endif}} |
| 46 |
{{if need_brctl}} find_program $BRCTL {{endif}} |
| 47 |
{{if need_ifenslave}} find_program $IFENSLAVE {{endif}} |
| 48 |
{{if need_ipset}} find_program $IPSET {{endif}} |
| 49 |
} |
| 50 |
|