runit_once 280 B

123456789101112131415161718192021
  1. # vim: ft=sh:
  2. # shellcheck shell=sh
  3. # ; nasm -felf64 pause.nasm -o pause.o && ld pause.o -o pause
  4. #
  5. #
  6. # SECTION .text
  7. # GLOBAL _start
  8. #
  9. # _start:
  10. # mov eax, 0x22
  11. # syscall
  12. #
  13. runit_once() {
  14. : "${PWD:=$(pwd)}"
  15. [ "${1:-}" ] && "${@}"
  16. exec chpst -b "${PWD##*/}" pause
  17. }