mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
new boolean logic yes
This commit is contained in:
parent
2464b9f47c
commit
5f6abfbb42
1 changed files with 18 additions and 5 deletions
|
@ -7,7 +7,7 @@ log_event() {
|
||||||
# Checking logging system
|
# Checking logging system
|
||||||
log_system=$(grep 'LOG_SYSTEM=' $V_CONF/vesta.conf | cut -f 2 -d \' )
|
log_system=$(grep 'LOG_SYSTEM=' $V_CONF/vesta.conf | cut -f 2 -d \' )
|
||||||
|
|
||||||
if [ "$log_system" = 'on' ]; then
|
if [ "$log_system" = 'yes' ]; then
|
||||||
# Checking logging level
|
# Checking logging level
|
||||||
log=$(grep 'LOG_LEVEL=' $V_CONF/vesta.conf|\
|
log=$(grep 'LOG_LEVEL=' $V_CONF/vesta.conf|\
|
||||||
cut -f 2 -d \'|grep -w "$level" )
|
cut -f 2 -d \'|grep -w "$level" )
|
||||||
|
@ -342,7 +342,7 @@ is_system_enabled() {
|
||||||
web_system=$(grep "WEB_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
web_system=$(grep "WEB_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
||||||
|
|
||||||
# Checking result
|
# Checking result
|
||||||
if [ -z "$web_system" ] || [ "$web_system" = "off" ]; then
|
if [ -z "$web_system" ] || [ "$web_system" = "no" ]; then
|
||||||
echo "Error: web hosting support disabled"
|
echo "Error: web hosting support disabled"
|
||||||
log_event 'debug' "$E_WEB_DISABLED $V_EVENT"
|
log_event 'debug' "$E_WEB_DISABLED $V_EVENT"
|
||||||
exit $E_WEB_DISABLED
|
exit $E_WEB_DISABLED
|
||||||
|
@ -366,7 +366,7 @@ is_system_enabled() {
|
||||||
dns_system=$(grep "DNS_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
dns_system=$(grep "DNS_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
||||||
|
|
||||||
# Checking result
|
# Checking result
|
||||||
if [ -z "$dns_system" ] || [ "$cron_system" = "off" ]; then
|
if [ -z "$dns_system" ] || [ "$cron_system" = "no" ]; then
|
||||||
echo "Error: dns support disabled"
|
echo "Error: dns support disabled"
|
||||||
log_event 'debug' "$E_DNS_DISABLED $V_EVENT"
|
log_event 'debug' "$E_DNS_DISABLED $V_EVENT"
|
||||||
exit $E_DNS_DISABLED
|
exit $E_DNS_DISABLED
|
||||||
|
@ -378,7 +378,7 @@ is_system_enabled() {
|
||||||
cron_system=$(grep "CRON_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
cron_system=$(grep "CRON_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
||||||
|
|
||||||
# Checking result
|
# Checking result
|
||||||
if [ -z "$cron_system" ] || [ "$cron_system" = "off" ]; then
|
if [ -z "$cron_system" ] || [ "$cron_system" = "no" ]; then
|
||||||
echo "Error: crond support disabled"
|
echo "Error: crond support disabled"
|
||||||
log_event 'debug' "$E_CRON_DISABLED $V_EVENT"
|
log_event 'debug' "$E_CRON_DISABLED $V_EVENT"
|
||||||
exit $E_CRON_DISABLED
|
exit $E_CRON_DISABLED
|
||||||
|
@ -390,19 +390,32 @@ is_system_enabled() {
|
||||||
db_system=$(grep "DB_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
db_system=$(grep "DB_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
||||||
|
|
||||||
# Checking result
|
# Checking result
|
||||||
if [ -z "$db_system" ] || [ "$db_system" = "off" ]; then
|
if [ -z "$db_system" ] || [ "$db_system" = "no" ]; then
|
||||||
echo "Error: db support disabled"
|
echo "Error: db support disabled"
|
||||||
log_event 'debug' "$E_DB_DISABLED $V_EVENT"
|
log_event 'debug' "$E_DB_DISABLED $V_EVENT"
|
||||||
exit $E_DB_DISABLED
|
exit $E_DB_DISABLED
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backup_function() {
|
||||||
|
# Parsing config
|
||||||
|
bck_system=$(grep "BACKUP_SYSTEM=" $V_CONF/vesta.conf|cut -f 2 -d \' )
|
||||||
|
|
||||||
|
# Checking result
|
||||||
|
if [ -z "$bck_system" ] || [ "$bck_system" = "no" ]; then
|
||||||
|
echo "Error: backup support disabled"
|
||||||
|
log_event 'debug' "$E_BACKUP_DISABLED $V_EVENT"
|
||||||
|
exit $E_BACKUP_DISABLED
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case $stype in
|
case $stype in
|
||||||
web) web_function ;;
|
web) web_function ;;
|
||||||
proxy) proxy_function ;;
|
proxy) proxy_function ;;
|
||||||
dns) dns_function ;;
|
dns) dns_function ;;
|
||||||
cron) cron_function ;;
|
cron) cron_function ;;
|
||||||
db) db_function ;;
|
db) db_function ;;
|
||||||
|
backup) backup_function ;;
|
||||||
*) check_args '1' '0' 'system'
|
*) check_args '1' '0' 'system'
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue