#!/bin/sh

# Add $ARGS for more arguments
[ -f ./conf ] && . ./conf

: ${USER:=_alertmanager}
: ${CONF_FILE:=/etc/alertmanager.yml}
: ${CONF_FLAG:=--config.file=$CONF_FILE}
: ${WRKDIR:=/var/lib/alertmanager}

cd "$WRKDIR"

exec chpst -u $USER alertmanager ${CONF_FLAG} ${ARGS}
