Skip to content

Commit

Permalink
Merge pull request #742 from msoudny/master
Browse files Browse the repository at this point in the history
changed setup.sh loopback creation
  • Loading branch information
yaazkal authored Nov 24, 2024
2 parents 8b6c537 + 4753006 commit 624a5c9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions usr/local/share/bastille/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,29 @@
bastille_config="/usr/local/etc/bastille/bastille.conf"
. /usr/local/share/bastille/common.sh
# shellcheck source=/usr/local/etc/bastille/bastille.conf

if [ ! -f "${bastille_config}" ]
then
cp /usr/local/etc/bastille/bastille.conf.sample ${bastille_config}
fi
. ${bastille_config}

usage() {
error_exit "Usage: bastille setup [pf|bastille0|zfs|vnet]"
error_exit "Usage: bastille setup [pf|network|zfs|vnet]"
}

# Check for too many args
if [ $# -gt 1 ]; then
usage
fi

# Configure bastille0 network interface
configure_bastille0() {
info "Configuring bastille0 loopback interface"
# Configure bastille loopback network interface
configure_network() {
info "Configuring ${bastille_network_loopback} loopback interface"
sysrc cloned_interfaces+=lo1
sysrc ifconfig_lo1_name="bastille0"
sysrc ifconfig_lo1_name="${bastille_network_loopback}"

info "Bringing up new interface: bastille0"
info "Bringing up new interface: ${bastille_network_loopback}"
service netif cloneup
}

Expand Down Expand Up @@ -123,7 +128,7 @@ configure_zfs() {
# Run all base functions (w/o vnet) if no args
if [ $# -eq 0 ]; then
sysrc bastille_enable=YES
configure_bastille0
configure_network
configure_pf
configure_zfs
fi
Expand All @@ -136,8 +141,8 @@ help|-h|--help)
pf|firewall)
configure_pf
;;
bastille0|loopback)
configure_bastille0
network|bastille0|loopback)
configure_network
;;
zfs|storage)
configure_zfs
Expand Down

0 comments on commit 624a5c9

Please sign in to comment.