@ -0,0 +1,26 @@
# RedPitaya hostname and user information
# (The user should have privilege to run `shutdown` - check out `visudo`)
# (Add local SSH key to RP's authorized keys for passwordless login)
# Issue shutdown on the RedPitaya
echo "Requesting shutdown on RP at $RP_HOST."
if [[ $RP_KEY == "" ]]
ssh $RP_USER@$RP_HOST "sudo shutdown now"
ssh -i $RP_KEY $RP_USER@$RP_HOST "sudo shutdown now"
# Check if RedPitaya has been disconnected from network by pinging
while ping $RP_HOST -c 1 >/dev/null 2>/dev/null
# Print time when RedPitaya is down on network
TIMESTAMP_PRETTY=$(date '+%Y-%m-%d %H:%M:%S')
echo "RP disconnected at $TIMESTAMP_PRETTY."