prepare.sh 358 B

12345678910111213141516171819
  1. #!/bin/sh
  2. set -eux
  3. if [ "$(id -u)" != 0 ] && sudo --preserve-env --non-interactive true; then
  4. echo >&2 "sudo already configured"
  5. exit 0
  6. fi
  7. useradd --user-group build
  8. echo 'build ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/build
  9. chmod 440 /etc/sudoers.d/build
  10. visudo --check
  11. if [ -n "${HOST:-}" ]; then
  12. update-binfmts --enable
  13. rm -f /dev/net/tun
  14. fi