#!/bin/bash -e

# This is documented here:
# https://docs.openshift.com/container-platform/3.10/creating_images/guidelines.html#openshift-specific-guidelines

if ! whoami &>/dev/null; then
  if [ -w /etc/passwd ]; then
    echo "${USER_NAME:-runner}:x:$(id -u):$(id -g):${USER_NAME:-runner} user:${HOME}:/sbin/nologin" >> /etc/passwd
  fi
fi

exec "${OPERATOR:-/usr/local/bin/ansible-operator}"
