mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
firewall cli
This commit is contained in:
parent
a42619cc28
commit
09e4c2d22e
7 changed files with 476 additions and 0 deletions
|
@ -187,6 +187,18 @@ if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then
|
|||
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
|
||||
fi
|
||||
|
||||
# FIREWALL
|
||||
service=$FIREWALL_SYSTEM
|
||||
if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then
|
||||
state="stopped"
|
||||
/sbin/iptables -L vesta >/dev/null 2>&1
|
||||
if [ "$?" -eq 0 ]; then
|
||||
state="running"
|
||||
fi
|
||||
str="$str\nNAME='$FIREWALL_SYSTEM' SYSTEM='firewall'"
|
||||
str="$str STATE='$state' CPU='0' MEM='0' RTIME='0'"
|
||||
fi
|
||||
|
||||
# Defining config
|
||||
echo -e "$str" > $tmp_file
|
||||
conf=$tmp_file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue