• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/kodi/br-kodi
Bernd KuhlsBernd Kuhls committed 3578459748d23 Dec 2014
Raw file
Source viewDiff to previous
 
1
#!/bin/sh
2
​
3
# We're called with the real Kodi executable as
4
# first argument, followed by any Kodi extra args
5
KODI="${1}"
6
shift
7
​
8
# In case someone asked we terminate, just kill
9
# the Kodi process
10
trap_kill() {
11
    LOOP=0
12
    killall "${KODI##*/}"
13
}
14
trap trap_kill INT QUIT TERM
15
​
16
LOOP=1
17
while [ ${LOOP} -eq 1 ]; do
18
    # Hack: BusyBox ash does not catch signals while a non-builtin
19
    # is running, and only catches the signal when the non-builtin
20
    # command ends. So, we just background the Kodi binary, and wait
21
    # for it. But BusyBox' ash's wait builtin does not return the
22
    # exit code even if there was only one job (which is correct
23
    # for POSIX). So we explicitly wait for the Kodi job
24
    "${KODI}" "${@}" &
25
    wait %1
26
    ret=$?
27
    case "${ret}" in
28
        0)  ;;
29
        64) poweroff; LOOP=0;;
30
        66) reboot;   LOOP=0;;
31
        *)  # Crash
32
            sleep 1
33
            ;;
34
    esac
35
done
36
exit ${ret}
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.