#!/bin/bash set -e CONF_DIR="/usr/local/freeswitch/conf" DEFAULT_CONF_DIR="/usr/local/freeswitch/default-conf" # Check if conf directory is empty or missing files if [ -z "$(ls -A "$CONF_DIR" 2>/dev/null)" ]; then echo "Configuration directory is empty. Copying default configuration..." cp -r "$DEFAULT_CONF_DIR"/* "$CONF_DIR"/ else echo "Configuration directory is already populated. Skipping copy." fi # Execute the main process exec /usr/local/freeswitch/bin/freeswitch