iopsys-feed/files/etc/init.d/btle_alarm
Stefan Nygren e4258501a9 Add uci configuration to package
Config file to be able to use UCI to store bluetooth mac of device
refs #6142
2015-04-01 10:36:11 +02:00

26 lines
487 B
Bash
Executable file

#!/bin/sh /etc/rc.common
#
# Copyright (C) 2009 OpenWrt.org
#
START=99
start() {
for i in down reset up;do
hciconfig hci0 $i
done
mac=`uci get btle_alarm.mac`
if [ $? -eq 0 ];then
hcitool lewladd $mac
else
hcitool lewladd D0:39:72:B6:43:8A
hcitool lewladd D0:39:72:B6:18:AA
fi
sleep 1
/sbin/btle_alarm
}
stop() {
hciconfig hci0 down
killall -9 btle_alarm
}