Script for connecting to Raspbmc

Standard

All my music and videos are stored on a drive connected to a Raspberry Pi running Raspbmc, and as I used a Acer C720 (ex)Chromebook1 with only 16GB of disk space, I tend to stream stuff over my home network.  For this, I use SSHFS and libnotify:

echo media_password | sshfs mediaonly@ip_address:/media/Media_Folder /home/user/pi -o follow_symlinks,password_stdin,uid=1000,gid=1000,umask=0 &&
notify-send "The Raspbmc box is connected yo"

Once connected, libnotify sends a message to the desktop.  It’s not ideal: the script stores the password in plain text, however the permissions are restricted and that user has no sudo rights.  I might see if I can tweak it to prompt for a password using Zenity perhaps.  I’ll update this when I do.

UPDATE: Duh – SSH keys is the way to go.

1. Got rid of ChromeOS and using Mint instead.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s