#!/bin/bash set -e # Check if we are running as root (default) if [ "$(id -u)" = "0" ]; then # If /data is a directory, change its ownership to the container user if [ -d "/data" ]; then echo "Setting ownership of /data to appuser:appgroup" chown -R appuser:appgroup /data fi # Drop privileges and run audio_splitter with the provided arguments exec gosu appuser audio_splitter "$@" else # If not root, just run audio_splitter directly # It's not supposed to be called exec audio_splitter "$@" fi