mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Firewall with Fail2ban support
This commit is contained in:
parent
f6926670fe
commit
357eb42647
27 changed files with 936 additions and 50 deletions
44
bin/v-list-firewall
Executable file
44
bin/v-list-firewall
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
# info: list iptables rules
|
||||
# options: [FORMAT]
|
||||
#
|
||||
# The function of obtaining the list of all iptables rules.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
format=${1-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Defining config
|
||||
conf=$VESTA/data/firewall/rules.conf
|
||||
|
||||
# Defining fileds to select
|
||||
fields="\$RULE \$ACTION \$PROTOCOL \$PORT \$IP \$COMMENT"
|
||||
fields="$fields \$RULE \$SUSPENDED \$TIME \$DATE"
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
json) json_list ;;
|
||||
plain) nohead=1; shell_list ;;
|
||||
shell) fields="\$ACTION \$PROTOCOL \$PORT \$IP";
|
||||
shell_list | column -t ;;
|
||||
*) check_args '1' '0' 'USER [FORMAT]'
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue