From 67b0ec5741d327d27afe88783d85fcf2c4c4f204 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 3 Nov 2013 12:30:45 +0100 Subject: First commit --- bin/mpc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 bin/mpc (limited to 'bin/mpc') diff --git a/bin/mpc b/bin/mpc new file mode 100644 index 0000000..cc85fd4 --- /dev/null +++ b/bin/mpc @@ -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 "$@" -- cgit v1.2.3-70-g09d2