"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "share/arno-iptables-firewall/plugins/10mac-address-filter.plugin" between
aif-2.1.0.tar.gz and aif-2.1.1.tar.gz

About: Arno’s iptables firewall is a stateful firewall script for both single and multi-homed machines with DSL/ADSL support.

10mac-address-filter.plugin  (aif-2.1.0):10mac-address-filter.plugin  (aif-2.1.1)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# -= Arno's Iptables Firewall(AIF) - MAC Address Filter plugin =- # -= Arno's Iptables Firewall(AIF) - MAC Address Filter plugin =-
# #
PLUGIN_NAME="MAC Address Filter plugin" PLUGIN_NAME="MAC Address Filter plugin"
PLUGIN_VERSION="1.1a" PLUGIN_VERSION="1.1b"
PLUGIN_CONF_FILE="mac-address-filter.conf" PLUGIN_CONF_FILE="mac-address-filter.conf"
# #
# Last changed : July 21, 2015 # Last changed : July 21, 2015
# Requirements : ipt_mac module # Requirements : ipt_mac module
# Comments : This plugin allows you to select the MAC addresses # Comments : This plugin allows you to select the MAC addresses
# that are allowed access for the specified interfaces # that are allowed access for the specified interfaces
# (eg. INT_IF) # (eg. INT_IF)
# #
# Author : (C) Copyright 2010-2015 by Arno van Amersfoort # Author : (C) Copyright 2010-2015 by Arno van Amersfoort
# Homepage : https://rocky.eld.leidenuniv.nl/ # Homepage : https://rocky.eld.leidenuniv.nl/
skipping to change at line 144 skipping to change at line 144
iptables -F MAC_FILTER iptables -F MAC_FILTER
iptables -X MAC_FILTER 2>/dev/null iptables -X MAC_FILTER 2>/dev/null
return 0 return 0
} }
# Plugin status function # Plugin status function
plugin_status() plugin_status()
{ {
# iptables -xnvL MAC_FILTER # iptables -xnvL MAC_FILTER |sed -e "s/^/$INDENT/"
return 0 return 0
} }
# Check sanity of eg. environment # Check sanity of eg. environment
plugin_sanity_check() plugin_sanity_check()
{ {
if [ -z "$MAC_ADDRESS_FILE" ] || [ ! -e "$MAC_ADDRESS_FILE" ]; then if [ ! -f "$MAC_ADDRESS_FILE" ]; then
printf "\033[40m\033[1;31m${INDENT}NOTE: Cannot read the allowed internal MA C address file \"$MAC_ADDRESS_FILE\".\033[0m\n" >&2 printf "\033[40m\033[1;31m${INDENT}NOTE: Cannot read the allowed internal MA C address file \"$MAC_ADDRESS_FILE\".\033[0m\n" >&2
return 1 return 1
fi fi
if [ -z "$MAC_ADDRESS_IF" ]; then if [ -z "$MAC_ADDRESS_IF" ]; then
printf "\033[40m\033[1;31m${INDENT}ERROR: The plugin config file is not prop erly set!\033[0m\n" >&2 printf "\033[40m\033[1;31m${INDENT}ERROR: The plugin config file is not prop erly set!\033[0m\n" >&2
return 1 return 1
fi fi
return 0 return 0
skipping to change at line 178 skipping to change at line 178
# Check where to find the config file # Check where to find the config file
CONF_FILE="" CONF_FILE=""
if [ -n "$PLUGIN_CONF_PATH" ]; then if [ -n "$PLUGIN_CONF_PATH" ]; then
CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE"
fi fi
# Preinit to success: # Preinit to success:
PLUGIN_RET_VAL=0 PLUGIN_RET_VAL=0
# Check if the config file exists # Check if the config file exists
if [ ! -e "$CONF_FILE" ]; then if [ ! -f "$CONF_FILE" ]; then
printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_ NAME v$PLUGIN_VERSION\" ignored!\n" >&2 printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_ NAME v$PLUGIN_VERSION\" ignored!\n" >&2
else else
# Source the plugin config file # Source the plugin config file
. "$CONF_FILE" . "$CONF_FILE"
if [ "$ENABLED" = "1" ] || if [ "$ENABLED" = "1" ] ||
[ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "stop" ] || [ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "stop" ] ||
[ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "status" ]; then [ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "status" ]; then
# Show who we are: # Show who we are:
echo "${INDENT}$PLUGIN_NAME v$PLUGIN_VERSION" echo "${INDENT}$PLUGIN_NAME v$PLUGIN_VERSION"
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)