aboutsummaryrefslogtreecommitdiffstats
path: root/bin/mpc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mpc')
-rw-r--r--bin/mpc38
1 files changed, 38 insertions, 0 deletions
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 "$@"