You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
665 B

  1. #!/bin/sh
  2. # Figure out latest release via GitHub API
  3. release=$(curl --silent "https://api.github.com/repos/krallin/tini/releases/latest" | jq -r .tag_name)
  4. # _Reliable_ way to get which arch for tini download
  5. arch=$(python <<EOF
  6. from __future__ import print_function
  7. import platform
  8. processor = platform.machine()
  9. if processor == 'aarch64':
  10. print('arm64', end='')
  11. elif processor == 'x86 64' or processor == 'x86_64':
  12. print('amd64', end='')
  13. elif processor == 'armv7l':
  14. print('armhf', end='')
  15. EOF
  16. )
  17. # Download/install tini
  18. curl -L https://github.com/krallin/tini/releases/download/$release/tini-static-$arch \
  19. -o /sbin/tini
  20. chmod a+x /sbin/tini