inits : combine identicals cases

This commit is contained in:
bolvan 2019-05-23 19:33:13 +03:00
parent 98f59f1d7b
commit d8dae093dd
2 changed files with 3 additions and 13 deletions

View File

@ -77,10 +77,7 @@ start_service() {
run_tpws 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP" run_tpws 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP"
run_tpws 2 "$TPWS_OPT_BASE_HTTPS $TPWS_OPT_HTTPS" run_tpws 2 "$TPWS_OPT_BASE_HTTPS $TPWS_OPT_HTTPS"
;; ;;
nfqws_ipset|nfqws_ipset_https) nfqws_ipset|nfqws_ipset_https|nfqws_all|nfqws_all_https)
run_daemon 1 $NFQWS "$NFQWS_OPT_BASE $NFQWS_OPT"
;;
nfqws_all|nfqws_all_https)
run_daemon 1 $NFQWS "$NFQWS_OPT_BASE $NFQWS_OPT" run_daemon 1 $NFQWS "$NFQWS_OPT_BASE $NFQWS_OPT"
;; ;;
custom) custom)

View File

@ -323,7 +323,7 @@ zapret_do_firewall()
# $1 - 1 - add, 0 - del # $1 - 1 - add, 0 - del
case "${MODE}" in case "${MODE}" in
tpws_hostlist) tpws_hostlist|tpws_all)
[ "$1" = "1" ] && prepare_tpws [ "$1" = "1" ] && prepare_tpws
fw_tpws $1 "--dport 80" "--dport 80" $TPPORT_HTTP fw_tpws $1 "--dport 80" "--dport 80" $TPPORT_HTTP
;; ;;
@ -338,10 +338,6 @@ zapret_do_firewall()
fw_tpws $1 "--dport 80 -m set --match-set zapret dst" "--dport 80 -m set --match-set zapret6 dst" $TPPORT_HTTP fw_tpws $1 "--dport 80 -m set --match-set zapret dst" "--dport 80 -m set --match-set zapret6 dst" $TPPORT_HTTP
fw_tpws $1 "--dport 443 -m set --match-set zapret dst" "--dport 443 -m set --match-set zapret6 dst" $TPPORT_HTTPS fw_tpws $1 "--dport 443 -m set --match-set zapret dst" "--dport 443 -m set --match-set zapret6 dst" $TPPORT_HTTPS
;; ;;
tpws_all)
[ "$1" = "1" ] && prepare_tpws
fw_tpws $1 "--dport 80" "--dport 80" $TPPORT_HTTP
;;
tpws_all_https) tpws_all_https)
[ "$1" = "1" ] && prepare_tpws [ "$1" = "1" ] && prepare_tpws
fw_tpws $1 "--dport 80" "--dport 80" $TPPORT_HTTP fw_tpws $1 "--dport 80" "--dport 80" $TPPORT_HTTP
@ -393,16 +389,13 @@ zapret_do_daemons()
tpws_hostlist) tpws_hostlist)
do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP --hostlist=$TPWS_HOSTLIST" do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP --hostlist=$TPWS_HOSTLIST"
;; ;;
tpws_ipset) tpws_ipset|tpws_all)
do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP" do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP"
;; ;;
tpws_ipset_https|tpws_all_https) tpws_ipset_https|tpws_all_https)
do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP" do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP"
do_tpws $1 2 "$TPWS_OPT_BASE_HTTPS $TPWS_OPT_HTTPS" do_tpws $1 2 "$TPWS_OPT_BASE_HTTPS $TPWS_OPT_HTTPS"
;; ;;
tpws_all)
do_tpws $1 1 "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP"
;;
nfqws_ipset|nfqws_ipset_https|nfqws_all|nfqws_all_https) nfqws_ipset|nfqws_ipset_https|nfqws_all|nfqws_all_https)
do_nfqws $1 1 "$NFQWS_OPT" do_nfqws $1 1 "$NFQWS_OPT"
;; ;;