From: <abe...@us...> - 2015-08-13 22:43:37
|
Revision: 7190 http://sourceforge.net/p/astlinux/code/7190 Author: abelbeck Date: 2015-08-13 22:43:35 +0000 (Thu, 13 Aug 2015) Log Message: ----------- arnofw, version bump to pre-release 2.0.1f Modified Paths: -------------- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh branches/1.0/package/arnofw/arnofw.mk branches/1.0/package/arnofw/arnofw.serial branches/1.0/package/arnofw/dyndns-host-open/50dyndns-host-open.plugin.sh branches/1.0/package/arnofw/miniupnpd/50miniupnpd.plugin.sh branches/1.0/package/arnofw/openvpn-server/50openvpn-server.plugin.sh branches/1.0/package/arnofw/pptp-vpn/50pptp-vpn.plugin.sh branches/1.0/package/arnofw/sip-user-agent/30sip-user-agent.plugin.sh branches/1.0/package/arnofw/time-schedule-host-block/30time-schedule-host-block.plugin.sh branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh Removed Paths: ------------- branches/1.0/package/arnofw/arnofw-NAT_LOCAL_REDIRECT.patch branches/1.0/package/arnofw/arnofw-enable-iptables-lock-wait.patch Modified: branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -164,10 +164,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -182,16 +184,15 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - stop ) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + stop ) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi - Deleted: branches/1.0/package/arnofw/arnofw-NAT_LOCAL_REDIRECT.patch =================================================================== --- branches/1.0/package/arnofw/arnofw-NAT_LOCAL_REDIRECT.patch 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/arnofw-NAT_LOCAL_REDIRECT.patch 2015-08-13 22:43:35 UTC (rev 7190) @@ -1,44 +0,0 @@ -From efc3c82552ec009a20252ed3e412aff3ef983fa2 Mon Sep 17 00:00:00 2001 -From: Lonnie Abelbeck <lo...@ab...> -Date: Mon, 28 Jul 2014 08:19:47 -0500 -Subject: [PATCH] fixed: Move NAT_LOCAL_REDIRECT to be applied before the drop - logs, Issue #13 - ---- - bin/arno-iptables-firewall | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/bin/arno-iptables-firewall b/bin/arno-iptables-firewall -index 0f74051..1e52ec8 100755 ---- a/bin/arno-iptables-firewall -+++ b/bin/arno-iptables-firewall -@@ -3373,6 +3373,13 @@ setup_ext_input_chain() - ip6tables -A EXT_INPUT_CHAIN -d ff00::/8 -j EXT_MULTICAST_CHAIN - fi - -+ # Allow all packets that have been locally redirected -+ ##################################################### -+ if [ "$NAT_LOCAL_REDIRECT" = "1" ]; then -+ echo " Enabling support for NAT local redirect" -+ ip4tables -A EXT_INPUT_CHAIN -m conntrack --ctstate DNAT -j ACCEPT -+ fi -+ - # Log packets to privileged TCP ports? - ################################################## - if [ "$PRIV_TCP_LOG" != "0" ]; then -@@ -3439,13 +3446,6 @@ setup_ext_input_chain() - echo " Logging of IPv4 IGMP packets disabled" - fi - -- # Allow all packets that have been locally redirected -- ##################################################### -- if [ "$NAT_LOCAL_REDIRECT" = "1" ]; then -- echo " Enabling support for NAT local redirect" -- ip4tables -A EXT_INPUT_CHAIN -m conntrack --ctstate DNAT -j ACCEPT -- fi -- - # Finally drop all in the broadcast chain - iptables -A EXT_BROADCAST_CHAIN -j DROP - --- -2.0.3 Deleted: branches/1.0/package/arnofw/arnofw-enable-iptables-lock-wait.patch =================================================================== --- branches/1.0/package/arnofw/arnofw-enable-iptables-lock-wait.patch 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/arnofw-enable-iptables-lock-wait.patch 2015-08-13 22:43:35 UTC (rev 7190) @@ -1,64 +0,0 @@ -From 8a5f13173cbc21b4c21b0fc97370f9882ef4cd94 Mon Sep 17 00:00:00 2001 -From: Lonnie Abelbeck <lo...@ab...> -Date: Mon, 3 Aug 2015 17:11:00 -0500 -Subject: [PATCH] fixed: Issue #17, Enable xtables lock "wait" option found in - iptables 1.4.20+ - ---- - share/arno-iptables-firewall/environment | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/share/arno-iptables-firewall/environment b/share/arno-iptables-firewall/environment -index 0fe708f..bc2d24e 100644 ---- a/share/arno-iptables-firewall/environment -+++ b/share/arno-iptables-firewall/environment -@@ -296,7 +296,7 @@ ip4tables() - { - local result retval IFS=' ' - -- result=`$IP4TABLES "$@" 2>&1` -+ result=`$IP4TABLES${IPTABLES_OPTIONS:+ $IPTABLES_OPTIONS} "$@" 2>&1` - retval=$? - - if [ $retval -ne 0 ]; then -@@ -323,7 +323,7 @@ ip6tables() - { - local result retval IFS=' ' - -- result=`$IP6TABLES "$@" 2>&1` -+ result=`$IP6TABLES${IPTABLES_OPTIONS:+ $IPTABLES_OPTIONS} "$@" 2>&1` - retval=$? - - if [ $retval -ne 0 ]; then -@@ -422,7 +422,7 @@ try_ip4tables() - { - local IFS=' ' - -- $IP4TABLES "$@" >/dev/null 2>&1 -+ $IP4TABLES${IPTABLES_OPTIONS:+ $IPTABLES_OPTIONS} "$@" >/dev/null 2>&1 - } - - -@@ -430,7 +430,7 @@ try_ip6tables() - { - local IFS=' ' - -- $IP6TABLES "$@" >/dev/null 2>&1 -+ $IP6TABLES${IPTABLES_OPTIONS:+ $IPTABLES_OPTIONS} "$@" >/dev/null 2>&1 - } - - -@@ -1672,6 +1672,13 @@ if [ -z "$DIG" ]; then - NSLOOKUP="$(find_command /usr/bin/nslookup)" - fi - -+# Enable xtables lock "wait" option found in iptables 1.4.20+ -+if $IP4TABLES -w --version >/dev/null 2>&1; then -+ IPTABLES_OPTIONS="-w" -+else -+ IPTABLES_OPTIONS="" -+fi -+ - # Setup IPv6 detected environment variable - if sysctl_key net.ipv6.conf; then - IPV6_DETECTED=1 Modified: branches/1.0/package/arnofw/arnofw.mk =================================================================== --- branches/1.0/package/arnofw/arnofw.mk 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/arnofw.mk 2015-08-13 22:43:35 UTC (rev 7190) @@ -3,20 +3,20 @@ # Arno's IPtables Firewall Script # ############################################################# -ARNOFW_VER:=2.0.1e -ARNOFW_ROOT:=arno-iptables-firewall -ARNOFW_SOURCE:=$(ARNOFW_ROOT)_$(ARNOFW_VER).tar.gz -ARNOFW_SITE:=http://rocky.eld.leidenuniv.nl/arno-iptables-firewall -#ARNOFW_SITE:=http://files.astlinux.org -ARNOFW_DIR:=$(BUILD_DIR)/$(ARNOFW_ROOT)_$(ARNOFW_VER) -ARNOFW_CAT:=zcat -ARNOFW_TARGET_BINARY:=/usr/sbin/arno-iptables-firewall -ARNOFW_CONFIG_DIR:=/etc/arno-iptables-firewall -ARNOFW_SCRIPT_DIR:=/usr/share/arno-iptables-firewall -ARNOFW_PLUGIN_CONFIG_DIR:=$(ARNOFW_CONFIG_DIR)/plugins -ARNOFW_PLUGIN_SCRIPT_DIR:=$(ARNOFW_SCRIPT_DIR)/plugins -ARNOFW_CONFIG_SHIM:=$(ARNOFW_SCRIPT_DIR)/astlinux.shim -ARNOFW_CONFIG_SERIAL:=$(ARNOFW_CONFIG_DIR)/serial +ARNOFW_VER := 2.0.1f-DEVEL +ARNOFW_ROOT := arno-iptables-firewall +ARNOFW_SOURCE := $(ARNOFW_ROOT)_$(ARNOFW_VER).tar.gz +#ARNOFW_SITE := http://rocky.eld.leidenuniv.nl/arno-iptables-firewall +ARNOFW_SITE := http://files.astlinux.org +ARNOFW_DIR := $(BUILD_DIR)/$(ARNOFW_ROOT)_$(ARNOFW_VER) +ARNOFW_CAT := zcat +ARNOFW_TARGET_BINARY := /usr/sbin/arno-iptables-firewall +ARNOFW_CONFIG_DIR := /etc/arno-iptables-firewall +ARNOFW_SCRIPT_DIR := /usr/share/arno-iptables-firewall +ARNOFW_PLUGIN_CONFIG_DIR := $(ARNOFW_CONFIG_DIR)/plugins +ARNOFW_PLUGIN_SCRIPT_DIR := $(ARNOFW_SCRIPT_DIR)/plugins +ARNOFW_CONFIG_SHIM := $(ARNOFW_SCRIPT_DIR)/astlinux.shim +ARNOFW_CONFIG_SERIAL := $(ARNOFW_CONFIG_DIR)/serial $(DL_DIR)/$(ARNOFW_SOURCE): $(WGET) -P $(DL_DIR) $(ARNOFW_SITE)/$(ARNOFW_SOURCE) @@ -50,8 +50,6 @@ -e 's:^ENV_FILE="[^"]*":ENV_FILE="$(ARNOFW_SCRIPT_DIR)/environment":' \ -e 's:^ENV_FILE=[^"]*$$:ENV_FILE="$(ARNOFW_SCRIPT_DIR)/environment":' \ -e 's:^LOCAL_CONFIG_FILE="":LOCAL_CONFIG_FILE="$(ARNOFW_CONFIG_SHIM)":' \ - -e 's:^IP4TABLES="[^"]*":IP4TABLES="$(IPTABLES_BIN)":' \ - -e 's:^IP6TABLES="[^"]*":IP6TABLES="$(IP6TABLES_BIN)":' \ -e 's:^(INT_IF|EXT_IF|MODEM_IF|INTERNAL_NET|NAT|NAT_INTERNAL_NET|EXT_IF_DHCP_IP)=:#&:' \ -e 's:^NAT_LOCAL_REDIRECT=0$$:NAT_LOCAL_REDIRECT=1:' \ -e 's:^IGMP_LOG=1$$:IGMP_LOG=0:' \ Modified: branches/1.0/package/arnofw/arnofw.serial =================================================================== --- branches/1.0/package/arnofw/arnofw.serial 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/arnofw.serial 2015-08-13 22:43:35 UTC (rev 7190) @@ -1 +1 @@ -0002~0024~0000~0000~0000~ +0002~0025~0000~0000~0000~ Modified: branches/1.0/package/arnofw/dyndns-host-open/50dyndns-host-open.plugin.sh =================================================================== --- branches/1.0/package/arnofw/dyndns-host-open/50dyndns-host-open.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/dyndns-host-open/50dyndns-host-open.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -243,10 +243,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -262,16 +264,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi Modified: branches/1.0/package/arnofw/miniupnpd/50miniupnpd.plugin.sh =================================================================== --- branches/1.0/package/arnofw/miniupnpd/50miniupnpd.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/miniupnpd/50miniupnpd.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -129,10 +129,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -148,17 +150,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi - Modified: branches/1.0/package/arnofw/openvpn-server/50openvpn-server.plugin.sh =================================================================== --- branches/1.0/package/arnofw/openvpn-server/50openvpn-server.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/openvpn-server/50openvpn-server.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -102,10 +102,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -121,16 +123,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi Modified: branches/1.0/package/arnofw/pptp-vpn/50pptp-vpn.plugin.sh =================================================================== --- branches/1.0/package/arnofw/pptp-vpn/50pptp-vpn.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/pptp-vpn/50pptp-vpn.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -185,10 +185,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -204,16 +206,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi Modified: branches/1.0/package/arnofw/sip-user-agent/30sip-user-agent.plugin.sh =================================================================== --- branches/1.0/package/arnofw/sip-user-agent/30sip-user-agent.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/sip-user-agent/30sip-user-agent.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -150,10 +150,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -169,16 +171,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi Modified: branches/1.0/package/arnofw/time-schedule-host-block/30time-schedule-host-block.plugin.sh =================================================================== --- branches/1.0/package/arnofw/time-schedule-host-block/30time-schedule-host-block.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/time-schedule-host-block/30time-schedule-host-block.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -234,10 +234,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -253,16 +255,16 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - restart ) plugin_restart; PLUGIN_RET_VAL=$?;; - stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; - * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + restart ) plugin_restart; PLUGIN_RET_VAL=$? ;; + stop|stop-restart) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; + * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi Modified: branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh =================================================================== --- branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh 2015-08-08 14:07:11 UTC (rev 7189) +++ branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh 2015-08-13 22:43:35 UTC (rev 7190) @@ -438,10 +438,12 @@ CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" fi +# Preinit to success: +PLUGIN_RET_VAL=0 + # Check if the config file exists if [ ! -e "$CONF_FILE" ]; then printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_NAME v$PLUGIN_VERSION\" ignored!\n" >&2 - PLUGIN_RET_VAL=0 else # Source the plugin config file . "$CONF_FILE" @@ -456,15 +458,15 @@ INDENT="$INDENT " # Only proceed if environment ok - if plugin_sanity_check; then + if ! plugin_sanity_check; then + PLUGIN_RET_VAL=1 + else case $PLUGIN_CMD in - start|'') plugin_start; PLUGIN_RET_VAL=$?;; - stop ) plugin_stop; PLUGIN_RET_VAL=$?;; - status ) plugin_status; PLUGIN_RET_VAL=$?;; + start|'') plugin_start; PLUGIN_RET_VAL=$? ;; + stop ) plugin_stop; PLUGIN_RET_VAL=$? ;; + status ) plugin_status; PLUGIN_RET_VAL=$? ;; * ) PLUGIN_RET_VAL=1; printf "\033[40m\033[1;31m${INDENT}ERROR: Invalid plugin option \"$PLUGIN_CMD\"!\033[0m\n" >&2 ;; esac fi - else - PLUGIN_RET_VAL=0 fi fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |