Last active
April 22, 2017 20:14
-
-
Save alepee/f7ccd132f43384ee5a0e039155a6e810 to your computer and use it in GitHub Desktop.
Receipes for Raspberry Pi management
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
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