From 9721f914657d2d0bc49c98bd655516eec567d039 Mon Sep 17 00:00:00 2001 From: sceox Date: Mon, 27 Dec 2021 15:36:45 -0800 Subject: [PATCH] automatically set getroot and firewall command by OS --- forumspam.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/forumspam.sh b/forumspam.sh index 3982f26..1af9132 100755 --- a/forumspam.sh +++ b/forumspam.sh @@ -3,16 +3,15 @@ # API reference: https://www.stopforumspam.com/usage # user configuration area - change as needed -ostype="bsd" # allowed options are bsd, linux logf=/var/log/forumspam.log limit=0 # number of violations allowed before blocking the ip -case "$ostype" in - bsd) +case `uname` in + (*"BSD"*) getroot="doas" fw_cmd="pfctl" ;; - linux) + (*) getroot="sudo" fw_cmd="ufw" ;;