19 righe
565 B
Bash
19 righe
565 B
Bash
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
CONFIG_FILE="/app/config.yaml"
|
||
|
|
PRESET_FILE="/app/config.preset.yaml"
|
||
|
|
|
||
|
|
echo "Checking configuration..."
|
||
|
|
|
||
|
|
# Se il file non esiste o è vuoto o non contiene 'models:', usa il preset
|
||
|
|
if [ ! -f "$CONFIG_FILE" ] || [ ! -s "$CONFIG_FILE" ] || ! grep -q "models:" "$CONFIG_FILE" 2>/dev/null; then
|
||
|
|
echo "Config file missing, empty, or invalid. Copying from preset..."
|
||
|
|
cp "$PRESET_FILE" "$CONFIG_FILE"
|
||
|
|
echo "Config file populated from preset."
|
||
|
|
else
|
||
|
|
echo "Config file found and valid."
|
||
|
|
fi
|
||
|
|
|
||
|
|
exec /app/llama-swap -config "$CONFIG_FILE" -listen :8080
|