26 lines
		
	
	
		
			501 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			501 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
# 2025-07-22 Hyperling
 | 
						|
# Create the necessary folders for LibreTranslate's volumes to work.
 | 
						|
# This must be run before the container will start properly.
 | 
						|
 | 
						|
## Setup ##
 | 
						|
 | 
						|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
 | 
						|
source $DIR/.env
 | 
						|
 | 
						|
## Main ##
 | 
						|
 | 
						|
# Create folders.
 | 
						|
if [[ $API_KEYS_DIR == "../*" ]]; then
 | 
						|
	API_KEYS_DIR="$DIR/$API_KEYS_DIR"
 | 
						|
fi
 | 
						|
mkdir -pv $API_KEYS_DIR
 | 
						|
 | 
						|
if [[ $MODELS_DIR == "../*" ]]; then
 | 
						|
	MODELS_DIR="$DIR/$MODELS_DIR"
 | 
						|
fi
 | 
						|
mkdir -pv $MODELS_DIR
 | 
						|
 | 
						|
# Finish successfully.
 | 
						|
exit 0
 |