diff --git a/config.conf.sample b/config.conf.sample index 34e70c0..1715f3d 100644 --- a/config.conf.sample +++ b/config.conf.sample @@ -9,7 +9,7 @@ THRESHOLD_INBOUND=0.5 THRESHOLD_OUTBOUND=0.5 # Messparameter -MEASUREMENT_COUNT=10 +MEASUREMENT_COUNT=15 INTERVAL=6 # SQL-Datenbankverbindung @@ -20,7 +20,8 @@ DB_NAME="database" # SSH-Verbindung SSH_KEY="/path/to/private_key" SSH_USER="user" -SSH_HOST="remote_host" +SSH_HOST="127.0.0.1" +SSH_PORT="22" # Neuzustartender Dienst SERVICE_NAME="ipsec.service" diff --git a/functions/restart_service.sh b/functions/restart_service.sh index e5c6147..dba6e02 100644 --- a/functions/restart_service.sh +++ b/functions/restart_service.sh @@ -8,13 +8,13 @@ function restart_service() { log_info "Attempting to restart service $SERVICE_NAME on $SSH_HOST." - ssh -i $SSH_KEY $SSH_USER@$SSH_HOST "sudo systemctl restart $SERVICE_NAME" + ssh -i $SSH_KEY -p $SSH_PORT $SSH_USER@$SSH_HOST "sudo systemctl restart $SERVICE_NAME" if [ $? -ne 0 ]; then log_error "Failed to restart service $SERVICE_NAME on $SSH_HOST." exit 2 fi - ssh -i $SSH_KEY $SSH_USER@$SSH_HOST "sudo ipsec statusall | grep -i '1 up, 0 connecting'" + ssh -i $SSH_KEY -p $SSH_PORT $SSH_USER@$SSH_HOST "sudo ipsec statusall | grep -i '1 up, 0 connecting'" if [ $? -ne 0 ]; then log_critical "Service $SERVICE_NAME not running after restart." exit 2