Script to run only on ups shutdown
Posted: 21 Aug 2023, 11:58
I have a script I want to run when the nas is on battery power.
How do I run the following script only on shutdown.
I am using a cp1500pfclcda on the approved list.
This script works standalone, everything shuts down the ups turns off.
When power is restored to the UPS everything powers up correctly.
file name in system: upsshutdown.sh and it is marked executable
#!/bin/bash
# Allow time to shutdown all systems.
upscmd -u username -p password ups load.off.delay 300
upscmd -u username -p password ups load.on.delay 300
# Shutdown Windows 11 Office computer, do not wait
net rpc shutdown -I 192.168.1.124 -U username%password
# Shutdown Windows 11 Gaming computer, do not wait
net rpc shutdown -I 192.168.1.141 -U username%password
# Now shutdown the nas
#shutdown -h "now
Any help will be appreciated.
How do I run the following script only on shutdown.
I am using a cp1500pfclcda on the approved list.
This script works standalone, everything shuts down the ups turns off.
When power is restored to the UPS everything powers up correctly.
file name in system: upsshutdown.sh and it is marked executable
#!/bin/bash
# Allow time to shutdown all systems.
upscmd -u username -p password ups load.off.delay 300
upscmd -u username -p password ups load.on.delay 300
# Shutdown Windows 11 Office computer, do not wait
net rpc shutdown -I 192.168.1.124 -U username%password
# Shutdown Windows 11 Gaming computer, do not wait
net rpc shutdown -I 192.168.1.141 -U username%password
# Now shutdown the nas
#shutdown -h "now
Any help will be appreciated.