Skip to content

Instantly share code, notes, and snippets.

@alepee
Last active April 22, 2017 20:14
Show Gist options
  • Save alepee/f7ccd132f43384ee5a0e039155a6e810 to your computer and use it in GitHub Desktop.
Save alepee/f7ccd132f43384ee5a0e039155a6e810 to your computer and use it in GitHub Desktop.
Receipes for Raspberry Pi management
LOCAL_IP_ADDRESS=$(ifconfig | grep -E -no "inet ([0-9]{1,3}\.*){4}" | cut -d" " -f2 | grep -v 127 | cut -d\n -f1)
LOCAL_IP_GROUP=$(echo $LOCAL_IP_ADDRESS | cut -d. -f1-3)
function rpi-connect
{
DEST_ADDR="$LOCAL_IP_GROUP.$1"
echo "Trying to connect to $DEST_ADDR"
ssh -i $HOME/.ssh/rpi pi@$DEST_ADDR
}
#function rpi-backup
#{
#}
#function rpi-restore
#{
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment