diff --git a/rp_start_uhubctl b/rp_start_uhubctl deleted file mode 100644 index 2bd7039..0000000 --- a/rp_start_uhubctl +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# Host where the smart USB hub is connected -# (uhubctl must be installed on the host) -export HOST=rpi-3 -export HOSTPORT=22 -# Hub port where the RedPitaya is connected -export HUBPORT=4 -# RedPitaya hostname -export RP_HOST=rp-f0612e - -# Get power-on time & date -TIMESTAMP_PRETTY=$(date '+%Y-%m-%d %H:%M:%S') -# Power on RedPitaya connected to the smart USB hub -# (assume that only 1 hub is connected) -ssh -p $HOSTPORT $HOST "uhubctl -a on -p $HUBPORT" -echo "RP powered on at $TIMESTAMP_PRETTY." - -# Check if RedPitaya becomes connectable from network by pinging -while true -do - ping $RP_HOST -c 1 >/dev/null 2>/dev/null && break -done -# Print time when RedPitaya ready on network -TIMESTAMP_PRETTY=$(date '+%Y-%m-%d %H:%M:%S') -echo "RP becomes connectable at $TIMESTAMP_PRETTY." diff --git a/rp_stop_uhubctl b/rp_stop_uhubctl deleted file mode 100644 index 544695d..0000000 --- a/rp_stop_uhubctl +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# Host where the smart USB hub is connected -# (uhubctl must be installed on the host) -export HOST=rpi-3 -export HOSTPORT=22 -# Hub port where the RedPitaya is connected -export HUBPORT=4 -# 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) -export RP_HOST=rp-f0612e -export RP_USER=tester -export RP_KEY=~/.ssh/rp - -# Issue shutdown on the RedPitaya -echo "Requesting shutdown on RP at $RP_HOST." -if [[ $RP_KEY == "" ]] -then - ssh $RP_USER@$RP_HOST "sudo shutdown 0" -else - ssh -i $RP_KEY $RP_USER@$RP_HOST "sudo shutdown 0" -fi - -# Check if RedPitaya has been disconnected from network by pinging -while ping $RP_HOST -c 1 >/dev/null 2>/dev/null -do - true -done -# Print time when RedPitaya is down on network -TIMESTAMP_PRETTY=$(date '+%Y-%m-%d %H:%M:%S') -echo "RP disconnected at $TIMESTAMP_PRETTY." -# Wait 15 seconds -sleep 15 - -# Get power-off time & date -TIMESTAMP_PRETTY=$(date '+%Y-%m-%d %H:%M:%S') -# Power off RedPitaya connected to the smart USB hub -# (assume that only 1 hub is connected) -ssh -p $HOSTPORT $HOST "uhubctl -a off -p $HUBPORT" -echo "RP powered off at $TIMESTAMP_PRETTY."