#!/bin/bash # Instala MorisBásic (por defecto), MorisPhoto o MorisVideo en Aplicaciones sin pasar por el bloqueo de macOS (descarga con curl: no se marca como "de internet"). # Uso: curl -fsSL https://juanmansoftware.pages.dev/instalar-mac.sh | bash (MorisBásic) # curl -fsSL https://juanmansoftware.pages.dev/instalar-mac.sh | bash -s -- photo|video # Código fuente y huellas: https://juanmansoftware.pages.dev/mac.html set -e APP="${1:-basic}" case "$APP" in basic) NAME="MorisBásic"; FILE="MorisBasic-1.0.0-Mac.dmg"; SHA="1d9d08e8414c40eaa5c1374c58c0a42e331bd178adb5878d40361ba7a415e047"; SIZE="243 MB";; photo) NAME="MorisPhoto"; FILE="MorisPhoto-1.0.0-mac-universal-regalo.dmg"; SHA="e1bd721ec273b95819c9b5bef251fbe3adb8dbf0ab229a1cf2b4b20f8cb476a8"; SIZE="249 MB";; *) echo "Uso: ... | bash -s -- [basic|photo|video]"; exit 1;; esac URL="https://juanmansoftware.pages.dev/descargas/$FILE" TMP="$(mktemp -d)"; DMG="$TMP/app.dmg"; MNT="$TMP/vol" echo "→ Descargando $NAME ($SIZE)…" curl -fL --progress-bar "$URL" -o "$DMG" echo "→ Comprobando la huella SHA-256…" GOT="$(shasum -a 256 "$DMG" | cut -d' ' -f1)" if [ "$GOT" != "$SHA" ]; then echo "✗ La huella no coincide. No se instala nada."; rm -rf "$TMP"; exit 1; fi echo "→ Instalando en Aplicaciones…" mkdir -p "$MNT"; hdiutil attach -nobrowse -readonly -quiet -mountpoint "$MNT" "$DMG" DEST="${MORIS_DEST:-/Applications}"; [ -w "$DEST" ] || DEST="$HOME/Applications"; mkdir -p "$DEST" rm -rf "$DEST/$NAME.app"; ditto "$MNT/$NAME.app" "$DEST/$NAME.app" hdiutil detach -quiet "$MNT" || true xattr -cr "$DEST/$NAME.app" 2>/dev/null || true rm -rf "$TMP" echo "✓ Listo: $DEST/$NAME.app" [ -n "${MORIS_NO_OPEN:-}" ] || open "$DEST/$NAME.app"