1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/sysutils/aird/files/aird.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

47 lines
1.1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: aird
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
# enable aird:
# aird_enable (bool): Set to "NO" by default.
# aird_key: Unset by default; see man page on pairing.
#
# The following options have defaults sane for musicpd, they can be reassigned
# in /etc/rc.conf
#
# aird_play, aird_forward, aird_up, aird_down, aird_back, aird_menu
. /etc/rc.subr
name="aird"
rcvar=aird_enable
load_rc_config $name
: ${aird_enable="NO"}
: ${aird_play="%%PREFIX%%/bin/mpc toggle"}
: ${aird_forward="%%PREFIX%%/bin/mpc next"}
: ${aird_up="/usr/sbin/mixer vol +2"}
: ${aird_down="/usr/sbin/mixer vol -2"}
: ${aird_back="%%PREFIX%%/bin/mpc prev"}
: ${aird_menu="%%PREFIX%%/bin/xterm -e ncmpc"}
aird_key="${aird_key:+-k ${aird_key}}"
command="%%PREFIX%%/bin/aird"
pidfile="/var/run/aird.pid"
command_args="-p ${pidfile} -f /dev/uhid1 ${aird_key}\
-P \"${aird_play}\" \
-F \"${aird_forward}\" \
-U \"${aird_up}\" \
-D \"${aird_down}\" \
-B \"${aird_back}\" \
-M \"${aird_menu}\""
run_rc_command "$1"