diff options
author | khronosschoty <khronosschoty@posteo.org> | 2022-02-16 15:25:36 -0800 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-02-17 12:55:24 +0700 |
commit | c21c4098e6f4459992e0e655eb7375c3483a3e1c (patch) | |
tree | a71b16e3196b626b6d9cc80cdd1677317c271719 /libraries | |
parent | 0545e796e3526cd23731ee16568a27025df065ac (diff) |
libraries/bluez-alsa: Added rc script
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/bluez-alsa/README | 11 | ||||
-rw-r--r-- | libraries/bluez-alsa/bluez-alsa.SlackBuild | 5 | ||||
-rw-r--r-- | libraries/bluez-alsa/rc.bluez-alsa | 24 |
3 files changed, 35 insertions, 5 deletions
diff --git a/libraries/bluez-alsa/README b/libraries/bluez-alsa/README index c30d02528eae..07c24be1b4a0 100644 --- a/libraries/bluez-alsa/README +++ b/libraries/bluez-alsa/README @@ -6,7 +6,12 @@ party audio applications. From now on, Bluez acts as a middleware between an audio application, which implements Bluetooth audio profile, and a Bluetooth audio device. -Note: you might want to "start" "/usr/bin/bluealsa" via rc.local -- -for example, add the following line to rc.local: +NOTE: A sample "rc" script is included, and installed in the usual location +i.e. /etc/rc.d -- to use this rc script do the usual: +chmod +x /etc/rc.d/rc.bluez-alsa - /usr/bin/bluealsa & +Then add the following to your rc.local: + # Start bluez-alsa + if [ -x /etc/rc.d/rc.bluez-alsa ]; then + /etc/rc.d/rc.bluez-alsa start + fi diff --git a/libraries/bluez-alsa/bluez-alsa.SlackBuild b/libraries/bluez-alsa/bluez-alsa.SlackBuild index b426140ce7b0..f60fd6416ef2 100644 --- a/libraries/bluez-alsa/bluez-alsa.SlackBuild +++ b/libraries/bluez-alsa/bluez-alsa.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for bluez-alsa -# Copyright 2018 Vasily Sora USA +# Copyright 2018,2022 Vasily Sora USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -105,9 +105,10 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKG/etc/rc.d cp -a README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild - +cat $CWD/rc.bluez-alsa > $PKG/etc/rc.d/rc.bluez-alsa rm -f $PKG/usr/lib*/*.la mkdir -p $PKG/install diff --git a/libraries/bluez-alsa/rc.bluez-alsa b/libraries/bluez-alsa/rc.bluez-alsa new file mode 100644 index 000000000000..94d83656a876 --- /dev/null +++ b/libraries/bluez-alsa/rc.bluez-alsa @@ -0,0 +1,24 @@ +#!/bin/sh +# +# /etc/rc.d/rc.bluez-alsa +# + +case "$1" in + 'start') + nohup /usr/bin/bluealsa > /dev/null 2>&1 & + echo $! > /var/run/bluealsa.pid + ;; + 'stop') + kill $(cat /var/run/bluealsa.pid) + rm -f /var/run/bluealsa.pid + ;; + 'restart') + kill $(cat /var/run/bluealsa.pid) + nohup /usr/bin/bluealsa > /dev/null 2>&1 & + echo $! > /var/run/bluealsa.pid + ;; + *) + echo "Usage: $0 {start|stop|restart}" + ;; +esac + |