#!/bin/sh # Initialize mc config if needed MC_CONFIG_DIR="/home/node/.mc" MC_CONFIG_FILE="$MC_CONFIG_DIR/config.json" # Create directory if it doesn't exist if [ ! -d "$MC_CONFIG_DIR" ]; then echo "Creating mc config directory..." mkdir -p "$MC_CONFIG_DIR" fi # If config doesn't exist, create a basic one if [ ! -f "$MC_CONFIG_FILE" ]; then echo "Creating initial mc config..." cat > "$MC_CONFIG_FILE" << 'EOF' { "version": "10", "aliases": {} } EOF fi # Ensure proper ownership chown -R node:node "$MC_CONFIG_DIR" chmod 755 "$MC_CONFIG_DIR" chmod 644 "$MC_CONFIG_FILE" echo "MC config initialized successfully"