Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/pf
Show All 17 Lines | |||||
check_cmd="pf_check" | check_cmd="pf_check" | ||||
reload_cmd="pf_reload" | reload_cmd="pf_reload" | ||||
resync_cmd="pf_resync" | resync_cmd="pf_resync" | ||||
status_cmd="pf_status" | status_cmd="pf_status" | ||||
extra_commands="check reload resync" | extra_commands="check reload resync" | ||||
required_files="$pf_rules" | required_files="$pf_rules" | ||||
required_modules="pf" | required_modules="pf" | ||||
pf_fallback() | |||||
{ | |||||
warn "Unable to load $pf_rules." | |||||
if ! checkyesno pf_fallback_rules_enable; then | |||||
return | |||||
fi | |||||
if [ -f $pf_fallback_rules_file ]; then | |||||
warn "Loading fallback rules file: $pf_fallback_rules_file" | |||||
$pf_program -f "$pf_fallback_rules_file" $pf_flags | |||||
else | |||||
warn "Loading fallback rules: $pf_fallback_rules" | |||||
echo $pf_fallback_rules | $pf_program -f - $pf_flags | |||||
donner: I feel bad with `echo -e` in order to generate multiple lines.
You may have a look at… | |||||
fi | |||||
} | |||||
pf_start() | pf_start() | ||||
{ | { | ||||
check_startmsgs && echo -n 'Enabling pf' | check_startmsgs && echo -n 'Enabling pf' | ||||
$pf_program -F all > /dev/null 2>&1 | $pf_program -F all > /dev/null 2>&1 | ||||
$pf_program -f "$pf_rules" $pf_flags | $pf_program -f "$pf_rules" $pf_flags || pf_fallback | ||||
Not Done Inline ActionsThe common idiom is donner: The common idiom is
`$pf_program -f "$pg_rules" $pf_flags || pf_fallback` | |||||
if ! $pf_program -s info | grep -q "Enabled" ; then | if ! $pf_program -s info | grep -q "Enabled" ; then | ||||
$pf_program -eq | $pf_program -eq | ||||
fi | fi | ||||
check_startmsgs && echo '.' | check_startmsgs && echo '.' | ||||
} | } | ||||
pf_stop() | pf_stop() | ||||
{ | { | ||||
Show All 37 Lines |
I feel bad with echo -e in order to generate multiple lines.
You may have a look at if_aliases. Why not simply