myvesta/bin/v-delete-sys-firewall
2016-06-09 16:55:35 +03:00

49 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# info: delete system firewall
# options: NONE
#
# The script disables firewall support
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
if [ -z "$FIREWALL_SYSTEM" ]; then
exit
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Stopping firewall
$BIN/v-stop-firewall
# Updating FIREWALL_SYSTEM value
if [ -z "$(grep FIREWALL_SYSTEM $VESTA/conf/vesta.conf)" ]; then
echo "FIREWALL_SYSTEM=''" >> $VESTA/conf/vesta.conf
else
sed -i "s/FIREWALL_SYSTEM=.*/FIREWALL_SYSTEM=''/g" $VESTA/conf/vesta.conf
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit