This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If you are too cheap (like me) to buy an expensive "smart" UPS, | |
# this script will allow you to use a Raspberry Pi or any SSH-enabled device | |
# to automatically shut down your DiskStation when the Pi loses power. | |
# Meaning you simply plug the "heartbeat device" into regular power, | |
# and your DiskStation into a UPS, and when the regular power is dead, | |
# the heartbeat device will die thus your synology will be unable to reach it | |
# and shut down in due time (10min default). | |
# This script will check if a given ssh command responds |