#!/bin/sh
#
# Aussom-Server host-side CLI wrapper.
#
# Copy this script onto your PATH (typically /usr/local/bin/aussom-server)
# after installing the container. From then on, run admin / utility
# operations without thinking about Docker:
#
#   aussom-server -k                  # generate a fresh encryption key
#   aussom-server -e "secret string"  # encrypt a value with the running key
#   aussom-server -v                  # print the version banner
#
# Container name defaults to "aussom-server"; override with the
# AUSSOM_CONTAINER environment variable for non-default deployments.
#
# Calls /opt/aussom-server/cli.sh inside the container, which carries
# the same env, config path, app dir, and lib classpath as the running
# server, so flags that need the encryption key just work.

exec docker exec -i "${AUSSOM_CONTAINER:-aussom-server}" \
    /opt/aussom-server/cli.sh "$@"
