diff options
author | Heinz Wiesinger <pprkut@slackbuilds.org> | 2010-05-11 20:30:47 +0200 |
---|---|---|
committer | Heinz Wiesinger <pprkut@slackbuilds.org> | 2010-05-11 20:30:47 +0200 |
commit | 0720ba2b2888995dd750f9f21ecb9d03084cc0b2 (patch) | |
tree | 23523eec3e8a5820e9c27ba17af6435fc3a87c77 /audio/herrie/herriectl | |
parent | f644b1ad3f26640a1fd20dbf86ebcc6983fb5dff (diff) | |
download | slackbuilds-0720ba2b2888995dd750f9f21ecb9d03084cc0b2.tar.gz |
audio/herrie: Moved from multimedia
Diffstat (limited to 'audio/herrie/herriectl')
-rw-r--r-- | audio/herrie/herriectl | 61 |
1 files changed, 61 insertions, 0 deletions
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 |