Skip to content

Instantly share code, notes, and snippets.

@DavidAntaramian
Created January 31, 2011 09:12
Show Gist options
  • Save DavidAntaramian/803806 to your computer and use it in GitHub Desktop.
Save DavidAntaramian/803806 to your computer and use it in GitHub Desktop.
rfcomm boot script
#! /bin/sh
#
### BEGIN INIT INFO
# Provides: rfcomm
# Required-Start: $syslog $local_fs dbus udev bluetooth
# Required-Stop: $syslog $local_fs dbus udev bluetooth
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bluetooth communication ports
# Description: Runs `rfcomm bind all` to create /dev/rfcomm*
# serial ports for bluetooth linking
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/rfcomm
NAME=rfcomm
DESC="Bluetooth communication ports"
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Binding bluetooth communication ports"
$DAEMON bind all
;;
stop)
echo -n "Releasing bluetooth communciation ports"
$DAEMON release all
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment