#!/usr/bin/env sh

if test "$1" -eq 256 ; then
  error_code=$((128 + $2))
else
  error_code="$1"
fi

if [ "${error_code}" -eq 0 ]; then
  s6-svc -d /run/s6-rc/servicedirs/async-service
  exit 0
else
  echo "${error_code}" > /run/s6-linux-init-container-results/exitcode
  stop async-service
fi

