mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
Firewall support enable/disable
This commit is contained in:
parent
b15b5e5cbd
commit
6626ba34bf
2 changed files with 105 additions and 0 deletions
48
bin/v-delete-sys-firewall
Executable file
48
bin/v-delete-sys-firewall
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
# info: delete system firewall
|
||||
# opions: 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" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue