k1x-factorytest/stress-ng.sh
2024-04-30 17:48:07 +08:00

18 lines
468 B
Bash
Executable file

#!/bin/bash
echo "Starting stress test..."
stress-ng --cpu 6 --cpu-method all --cpu-load 50 --metrics-brief &
# Get the process ID of the stress-ng instance
stress_ng_pid=$!
# Wait for the process to finish
wait $stress_ng_pid
# Check the exit status of stress-ng process
if [ $? -eq 0 ]; then
echo "Stress test completed successfully."
else
echo "Stress test encountered an error or exited prematurely."
echo none > /sys/class/leds/sys-led/trigger
fi