#!/bin/bash

set -e

ENVI=""
if [[ "${ASUSER_EMPTY_ENV:-}" = 1 ]]; then
  ENVI="env -i"
fi

echo "${1:-}" | ${ENVI} /usr/bin/sudo -u "${2:-root}" --stdin id -u > "${3:-stdout}" 2> "${4:-stderr}"
