Skip to content

Commit 62f1a0c

Browse files
authored
Update 30_bluetooth.sh
1 parent 55fd36c commit 62f1a0c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts.d/30_bluetooth.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,24 @@ cat mnt/img_root/lib/systemd/system/bluetooth.service
2020
mkdir -p mnt/img_root/etc/systemd/system/bluetooth.service.d
2121
echo -e "[Service]\nExecStart=\nExecStart=/usr/sbin/bluetoothd --noplugin=input --compat" > mnt/img_root/etc/systemd/system/bluetooth.service.d/override.conf
2222
cat mnt/img_root/etc/systemd/system/bluetooth.service.d/override.conf
23+
24+
cat << EOF > mnt/img_root/etc/systemd/system/rpibluetooth.service
25+
[Unit]
26+
Description=Bluetooth Server
27+
After=bluetooth.service
28+
Requires=bluetooth.service
29+
30+
StartLimitIntervalSec=500
31+
StartLimitBurst=5
32+
33+
[Service]
34+
ExecStart=/usr/bin/python3 /usr/local/bin/bluetooth-server.py
35+
Restart=always
36+
RestartSec=5s
37+
38+
[Install]
39+
WantedBy=multi-user.target
40+
EOF
41+
42+
_op _chroot chmod +x /etc/systemd/system/rpibluetooth.service
43+
_op _chroot systemctl enable rpibluetooth

0 commit comments

Comments
 (0)