#!/usr/bin/env bash # 2026-07-04 Hyperling # Create the necessary folders for volumes to work. # This must be run before the container will start properly. ## Setup ## DIR="$(dirname -- "${BASH_SOURCE[0]}")" env="$DIR"/.env if [[ ! -f "$env" ]]; then cp -v "$DIR"/example.env "$env" fi source "$env" ## Main ## # Create folders. mkdir -pv $FDROID_DATA keystore="$DIR"/files/keystore.p12 if [[ ! -f "$keystore" ]]; then echo "ERROR: Keystore not detected. Please create it using 'keytool', like this:" cat <<- EOF keytool -genkeypair -v \\ -storetype PKCS12 \\ -keystore keystore.p12 \\ -alias fdroid \\ -keyalg RSA -keysize 4096 \\ -validity 10000 \\ -dname "CN=YourName, OU=F-Droid" EOF echo "It will ask for passwords, it's recommended to make them both the same." exit 1 fi # Finish successfully. exit 0