Verschiebe in Root
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source Konfigurations- und Modul-Dateien
|
||||
source config.conf
|
||||
source functions/logging.sh
|
||||
source functions/network_check.sh
|
||||
source functions/sql_check.sh
|
||||
source functions/restart_service.sh
|
||||
|
||||
# Funktion zur Prüfung der Arbeitszeit
|
||||
function is_within_business_hours() {
|
||||
current_hour=$(date +%H)
|
||||
if (( current_hour >= 7 && current_hour < 18 )); then
|
||||
return 0 # True
|
||||
else
|
||||
return 1 # False
|
||||
fi
|
||||
}
|
||||
|
||||
# Hauptlogik
|
||||
function main() {
|
||||
log_info "Starting VPN monitoring script."
|
||||
|
||||
if is_within_business_hours; then
|
||||
log_info "Within business hours. Running network check."
|
||||
check_network_traffic
|
||||
else
|
||||
log_info "Outside business hours. Running SQL activity check."
|
||||
check_sql_activity
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user