2023-06-27 19:53:52 -07:00
|
|
|
#!/usr/bin/env bash
|
2023-11-04 20:56:58 -07:00
|
|
|
# @file Firewall Configuration
|
|
|
|
# @brief Configures the firewall (built-in for macOS and firewall-cmd / ufw for Linux)
|
|
|
|
# @description
|
|
|
|
# This script configures the firewall for macOS / Linux.
|
|
|
|
|
|
|
|
{{- includeTemplate "universal/profile" }}
|
|
|
|
{{- includeTemplate "universal/logg" }}
|
2023-06-27 19:53:52 -07:00
|
|
|
|
|
|
|
if [ -d /Applications ] && [ -d /System ]; then
|
|
|
|
# System is macOS
|
|
|
|
logg info 'Enabling macOS firewall'
|
2023-11-04 20:56:58 -07:00
|
|
|
elif command -v firewall-cmd > /dev/null; then
|
|
|
|
# System is Linux and has firewall-cmd present in PATH
|
|
|
|
logg info 'Setting up firewall using firewall-cmd'
|
|
|
|
elif command -v ufw > /dev/null; then
|
|
|
|
# System is Linux and has ufw present in PATH
|
|
|
|
logg info 'Setting up firewall using ufw'
|
|
|
|
fi
|