#! /usr/bin/env bash BAN_IP="$HOME/scripts/ban-ip-forward" BAN_IP_RANGE="$HOME/scripts/ban-iprange-forward" while read l; do c=$(echo "$l" | cut -d'#' -f1 | xargs) if [[ "${l:0:1}" == "s" ]] then $BAN_IP "${c:2}" elif [[ "${l:0:1}" == "r" ]] then $BAN_IP_RANGE "${c:2}" elif [[ "${l:0:1}" == "f" ]] then echo "You have forgiven "${c:2}"." fi done <$1