Created
June 21, 2025 17:19
-
-
Save fabio777s/39557f1b8ac7b0dbe5d6f91eb5ca2798 to your computer and use it in GitHub Desktop.
lol activate metal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# league-metal-external.sh | |
# Habilita Metal API para LoL, buscando primero en disco externo. | |
set -e | |
ENABLE_METAL_API_KEY="MetalBetaTest" | |
if [[ $(uname) != "Darwin" ]]; then | |
echo "Este script debe ejecutarse en macOS." | |
exit 1 | |
fi | |
if [[ -d "/Volumes/WD-2TB/Games/League of Legends.app" ]]; then | |
LOL_PATH="/Volumes/WD-2TB/Games/League of Legends.app" | |
elif [[ -d "/Applications/League of Legends.app" ]]; then | |
LOL_PATH="/Applications/League of Legends.app" | |
elif [[ -d "$HOME/Applications/League of Legends.app" ]]; then | |
LOL_PATH="$HOME/Applications/League of Legends.app" | |
else | |
echo "No se encontró League of Legends." | |
read -p "Ingresa la ruta completa a League of Legends.app: " LOL_PATH | |
if [[ ! -d "$LOL_PATH" ]]; then | |
echo "Ruta inválida: $LOL_PATH" | |
exit 1 | |
fi | |
fi | |
if pgrep "League of Legends" > /dev/null; then | |
echo "League of Legends está corriendo. Ciérralo y vuelve a intentar." | |
exit 1 | |
fi | |
GAME_CFG_PATH="$LOL_PATH/Contents/LoL/Config/game.cfg" | |
if [[ ! -f "$GAME_CFG_PATH" ]]; then | |
echo "game.cfg no existe, se creará..." | |
mkdir -p "$(dirname "$GAME_CFG_PATH")" | |
printf "[General]\r\n" > "$GAME_CFG_PATH" | |
fi | |
if grep -q "$ENABLE_METAL_API_KEY=1" "$GAME_CFG_PATH"; then | |
echo "Metal API ya está habilitado." | |
exit 0 | |
fi | |
echo "Habilitando Metal API..." | |
sed -i '' "/$ENABLE_METAL_API_KEY/d" "$GAME_CFG_PATH" | |
sed -i '' "/\[General\]/a\\ | |
$ENABLE_METAL_API_KEY=1"$'\r\n' "$GAME_CFG_PATH" | |
echo "¡Listo! Metal API activado para League of Legends." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment