setup now references bastille_pf_conf variable

This commit is contained in:
Christer Edwards
2023-07-14 21:07:36 -06:00
parent 15f2ea8574
commit e15a481e46

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2018-2022, Christer Edwards <christer.edwards@gmail.com>
# Copyright (c) 2018-2023, Christer Edwards <christer.edwards@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -60,14 +60,14 @@ configure_vnet() {
# Configure pf firewall
configure_pf() {
if [ ! -f "/etc/pf.conf" ]; then
if [ ! -f "${bastille_pf_conf}" ]; then
local ext_if
ext_if=$(netstat -rn | awk '/default/ {print $4}' | head -n1)
info "Determined default network interface: ($ext_if)"
info "/etc/pf.conf does not exist: creating..."
info "${bastille_pf_conf} does not exist: creating..."
## creating pf.conf
cat << EOF > /etc/pf.conf
cat << EOF > ${bastille_pf_conf}
## generated by bastille setup
ext_if="$ext_if"
@@ -86,7 +86,7 @@ pass in inet proto tcp from any to any port ssh flags S/SA keep state
EOF
sysrc pf_enable=YES
else
error_exit "/etc/pf.conf already exists. Exiting."
error_exit "${bastille_pf_conf} already exists. Exiting."
fi
}