install.fairie/home/.chezmoiscripts_disabled/disabled/run_onchange_after_18-configure-firewall.sh.tmpl
2024-02-27 09:21:12 +00:00

19 lines
707 B
Bash

#!/usr/bin/env bash
# @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" }}
if [ -d /Applications ] && [ -d /System ]; then
# System is macOS
logg info 'Enabling macOS firewall'
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