Skip to content

Instantly share code, notes, and snippets.

@mariusz
Forked from ku1ik/gist:1716868
Created February 1, 2012 13:27
Show Gist options
  • Save mariusz/1716948 to your computer and use it in GitHub Desktop.
Save mariusz/1716948 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
HOST="192.168.20.205"
if [[ "$1" == "play" ]]; then
if [[ -n "$2" ]]; then
mpc -h $HOST clear
mpc -h $HOST add "$2"
fi
mpc -h $HOST play
elif [[ "$1" == "ls" ]]; then
echo "Library:"
echo
mpc -h $HOST listall
elif [[ "$1" == "upload" ]]; then
scp "$2" "rubydev@$HOST:~/Music/"
mpc -h $HOST update
mpc -h $HOST clear
mpc -h $HOST findadd filename $(basename "$2")
mpc -h $HOST play
elif [[ "$1" == "update" ]]; then
curl https://raw.github.com/gist/1716868/gistfile1.sh -o "$0" 2>/dev/null && echo "Updated!" || echo "Fail!"
else
echo "usage: $0 { play <NAME> | lib | ls | upload <LOCAL_FILE> | update }"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment