The main purpose is to solve the problem of the machine suddenly dropping its IP address, so I wrote a simple monitoring script.
This is a simple trick, you can directly use the User Scripts Plugin of unraid CA.
Create a new script, fill in the name and description as you like, and the script content is as follows:
#!/bin/bash
ping fun2ex.com -c 1 >/dev/null
if [ $? -ne 0 ];then
# powerdown -r
echo `date` powerdown restart >> /tmp/powerdown_logs.txt
fi
The check time is set manually, just add it according to the cron rules. Considering the time for the array to shut down, I set it to check every 30 minutes.
# cron setting
*/30 * * * *
--EOF--