1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-11 20:26:30 -07:00
vesta/bin/v-unsuspend-firewall-rule

50 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2014-09-17 00:32:25 +03:00
#!/bin/bash
2014-10-05 14:52:15 +03:00
# info: unsuspend firewall rule
2014-09-17 00:32:25 +03:00
# options: RULE
#
2014-10-05 14:52:15 +03:00
# The function unsuspends a certain firewall rule.
2014-09-17 00:32:25 +03:00
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
2015-11-06 17:38:58 +02:00
# Argument definition
2014-09-17 00:32:25 +03:00
rule=$1
2015-11-06 17:38:58 +02:00
# Includes
2014-09-17 00:32:25 +03:00
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'RULE'
is_format_valid 'rule'
2014-09-17 00:32:25 +03:00
is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
2014-10-05 14:52:15 +03:00
is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
is_object_suspended '../../data/firewall/rules' 'RULE' "$rule"
2014-09-17 00:32:25 +03:00
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
2014-10-05 14:52:15 +03:00
# Suspending rule
update_object_value ../../data/firewall/rules RULE $rule '$SUSPENDED' no
2014-09-17 00:32:25 +03:00
# Updating system firewall
2014-10-05 14:52:15 +03:00
$BIN/v-update-firewall
2014-09-17 00:32:25 +03:00
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
2014-09-17 00:32:25 +03:00
exit