Spaces:
Build error
Build error
Download load.sh from FLODARELTIH/MinecraftServer: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/spaces/FLODARELTIH/MinecraftServer/resolve/main/load.sh
- Command line
-
hf download hf://spaces/FLODARELTIH/MinecraftServer/load.sh
-
curl -L -o load.sh https://huggingface.co/spaces/FLODARELTIH/MinecraftServer/resolve/main/load.sh
675 Bytes
| # Verifica que se haya pasado un parámetro | |
| if [ "$#" -ne 2 ]; then | |
| echo "Uso: $0 <url_json> <archivo_salida>" | |
| exit 0 | |
| fi | |
| url_json=$1 | |
| archivo_salida=$2 | |
| # Obtiene el contenido JSON desde la URL | |
| json=$(curl -s "$url_json") | |
| # Extrae el valor del campo 'file' | |
| file=$(echo "$json"| tr -cd "[:print:]" | jq -r '.file') | |
| # Verifica si el campo 'file' está vacío | |
| if [ -z "$file" ]; then | |
| echo "El campo 'file' está vacío. No se realizará ninguna acción." | |
| else | |
| # Decodifica el valor de base64 y lo guarda en el archivo de salida | |
| echo "$file" | base64 --decode > "$archivo_salida" | |
| echo "El contenido ha sido guardado en $archivo_salida." | |
| fi | |