From 0720ba2b2888995dd750f9f21ecb9d03084cc0b2 Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Tue, 11 May 2010 20:30:47 +0200 Subject: audio/herrie: Moved from multimedia --- audio/herrie/herriectl | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 audio/herrie/herriectl (limited to 'audio/herrie/herriectl') diff --git a/audio/herrie/herriectl b/audio/herrie/herriectl new file mode 100644 index 0000000000..259e777d80 --- /dev/null +++ b/audio/herrie/herriectl @@ -0,0 +1,61 @@ +#!/bin/sh + +# herriectl +# This script sends varying signals to all running instances of herrie +# with the same effective uid as the process running this script +# The signal sent is based upon the input argument +# Written by Phillip Warner + +VERSION=0.1 + +# Signales that correspond to functions +SPLAY="SIGRTMIN+1" +SSTOP="SIGRTMIN+2" +SPAUSE="SIGUSR1" +SNEXT="SIGUSR2" +SPREV="SIGRTMIN+3" + +usage() { + echo "$(basename $0) $VERSION - by Phillip Warner" + echo "Usage:" + echo " $0 [OPTION]" + echo "Only one parameter can be used at a time." + echo "The script's parameters are:" + echo " -h, --help Help" + echo " -b, --next Play Next" + echo " -c, --pause Pause" + echo " -v, --stop Stop" + echo " -x, --play Play Selected" + echo " -z, --previous Play Previous" + echo + echo "Current herrie PIDs (euid=$(id -u)):" + pgrep -u $(id -u) herrie$ +} + +# Make sure there is no more than one arg +if [ $2 ] +then + usage +elif [ $1 ] +then + case $1 in + -h|--help ) usage + ;; + -b|--next ) pkill -$SNEXT -u $(id -u) herrie$ + ;; + -c|--pause ) pkill -$SPAUSE -u $(id -u) herrie$ + ;; + -v|--stop ) pkill -$SSTOP -u $(id -u) herrie$ + ;; + -x|--play ) pkill -$SPLAY -u $(id -u) herrie$ + ;; + -z|--previous ) pkill -$SPREV -u $(id -u) herrie$ + ;; + * ) usage + ;; + esac +else + usage +fi + +exit -- cgit v1.2.3