Add exit at network check, config.conf > config.conf.sample
This commit is contained in:
@@ -60,7 +60,7 @@ Dieses Projekt implementiert ein flexibles und robustes VPN-Überwachungsskript,
|
||||
chmod +x functions/*.sh
|
||||
```
|
||||
|
||||
4. Passe die `config.conf` Datei an:
|
||||
4. Kopiere `config.conf.sample` zu `config.conf` und passe die Datei an:
|
||||
- Definiere Netzwerkinterface, Schwellenwerte, Datenbankeinstellungen, SSH-Details und Logdateipfad.
|
||||
|
||||
5. (Optional) Füge die Logrotation hinzu:
|
||||
|
||||
@@ -25,7 +25,9 @@ function check_network_traffic() {
|
||||
if (( $(echo "$avg_inbound < $THRESHOLD_INBOUND" | bc -l) )) || (( $(echo "$avg_outbound < $THRESHOLD_OUTBOUND" | bc -l) )); then
|
||||
log_critical "Network traffic below thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s."
|
||||
restart_service
|
||||
exit 2 # Exit with error status if thresholds are not met
|
||||
else
|
||||
log_info "Network traffic is above thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s."
|
||||
exit 0 # Exit with success status
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user