How to run a script only on Shutdown but not on Restart

canute4444

Dabbler
Joined
Jul 7, 2021
Messages
16
Hi,

I have a Bash script that I run on Shutdown using Tasks > Init/Shutdown Script.

It powers down another remote machine on Shutdown using ssh.
Problem is that I do not want the remote machine shutdown my TrueNAS Core machine is being Restarted

Is there any way to detect the 'Restart' inside the Shutdown script?
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
I think you need to write an rc.d script
 
Top