Files
forge-kasm/custom_startup.sh
Ryan Hamilton 2bff3e6101
All checks were successful
Build & Push Forge-Kasm / docker (push) Successful in 28s
Refactor custom startup script to set up shared Forge image cache and handle symlink creation
2025-06-06 19:02:39 -05:00

29 lines
663 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
# Optional: maximize Forge window
if [[ -x $STARTUPDIR/maximize_window.sh ]]; then
bash $STARTUPDIR/maximize_window.sh &
fi
# Set up shared card image cache
SHARED_CACHE="/forge-shared-cache"
FORGE_CACHE="$HOME/.cache/forge/pics"
mkdir -p "$(dirname "$FORGE_CACHE")"
# Replace cache with symlink if needed
if [ ! -L "$FORGE_CACHE" ]; then
rm -rf "$FORGE_CACHE"
ln -s "$SHARED_CACHE" "$FORGE_CACHE"
echo "✔ Forge image cache linked to $SHARED_CACHE"
else
echo " Forge image cache already linked"
fi
# Launch Forge
exec /opt/forge/forge.sh