-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrc.local.auto
More file actions
executable file
·36 lines (31 loc) · 1.15 KB
/
rc.local.auto
File metadata and controls
executable file
·36 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh -e
#
# rc.local (auto-negotiation mode)
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# This rc.local is used for auto-negotiation mode where any device can
# be the master. All devices run the keyboard controller for sync triggering.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Run first-boot hostname setup if needed
if [ -f /home/pi/media-mux/.first-boot-pending ]; then
/home/pi/media-mux/media-mux-first-boot.sh
fi
su -l pi -c "/home/pi/media-mux/avahi-publish-media-mux.sh" &
sleep 25 # wait for all other systems including dhcp server to be ready
# Start keyboard controller - it needs to grab the device before Kodi
# In auto-negotiation mode, any device can trigger sync
su -l pi -c "/home/pi/media-mux/media-mux-controller" &
sleep 2 # Give controller time to grab the keyboard device
# Start Kodi after controller has grabbed the keyboard
su -l pi -c "/usr/bin/kodi --standalone -fs &" &
exit 0