mirror of
https://github.com/BastilleBSD/bastille.git
synced 2025-12-11 01:19:52 +01:00
setup now references bastille_pf_conf variable
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user