diff options
author | David Runge <david.runge@frqrec.com> | 2013-11-03 12:30:45 +0100 |
---|---|---|
committer | David Runge <david.runge@frqrec.com> | 2013-11-03 12:30:45 +0100 |
commit | 67b0ec5741d327d27afe88783d85fcf2c4c4f204 (patch) | |
tree | 4ea47807c5e775927b96eb79933c09fbfcd0468e /bin/mpc | |
download | dotfiles-67b0ec5741d327d27afe88783d85fcf2c4c4f204.tar.gz dotfiles-67b0ec5741d327d27afe88783d85fcf2c4c4f204.tar.bz2 dotfiles-67b0ec5741d327d27afe88783d85fcf2c4c4f204.tar.xz dotfiles-67b0ec5741d327d27afe88783d85fcf2c4c4f204.zip |
First commit
Diffstat (limited to 'bin/mpc')
-rw-r--r-- | bin/mpc | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +#!/bin/bash +file=/tmp/mpdhost + +if [ -e $file ] +then + mpdhost=$(cat $file) +else + case $(hostname) in + "dvzrv") + mpdhost=dvzrv + ;; + *) + mpdhost=homey + ;; + esac +fi + +case $1 in + "switch") + case "$mpdhost" in + "dvzrv") + mpdhost=homey + ;; + *) + mpdhost=dvzrv + ;; + esac + echo $mpdhost > $file + echo switched to $mpdhost + shift + ;; + "host") + echo $mpdhost + exit 0 + ;; +esac + +/usr/bin/mpc -h $mpdhost "$@" |