#!/bin/sh # ALL - Universal Computer MCP # curl -fsSL https://all-mcp.fyi/install | sh # Source and details: https://all-mcp.fyi/install set -eu all_detect_lang() { for _all_l in "${ALL_INSTALL_LANG:-${ALL_INSTALL_LOCALE:-}}" "${LC_ALL:-}" "${LC_MESSAGES:-}" "${LANGUAGE:-}" "${LANG:-}"; do case "$_all_l" in es*|ES*) echo es; return ;; en*|EN*) echo en; return ;; esac done if [ "$(uname -s 2>/dev/null)" = Darwin ]; then case "$(defaults read -g AppleLanguages 2>/dev/null | tr -d ' "(),' | sed -n '/./{p;q;}')" in es*) echo es; return ;; esac fi echo en } ALL_LANG="$(all_detect_lang)" all_say() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "$2"; else printf '%s\n' "$1"; fi; } pause_all() { if [ -t 0 ] && [ -z "${ALL_NO_PAUSE:-}" ]; then if [ "$ALL_LANG" = es ]; then printf '%s' "Presiona Enter para cerrar…"; else printf '%s' "Press Enter to close…"; fi IFS= read -r _all_pause || true fi } all_main() { SITE='https://all-mcp.fyi' case "$(uname -s 2>/dev/null)" in Darwin) _file='ALL-Installer-macOS.sh'; _shell=bash ;; Linux) _file='ALL-Installer-Linux.run'; _shell=sh ;; *) all_say "This command is for macOS and Linux. On Windows, open PowerShell and run: irm $SITE/install.ps1 | iex" \ "Este comando es para macOS y Linux. En Windows abre PowerShell y ejecuta: irm $SITE/install.ps1 | iex" >&2 exit 1 ;; esac if command -v curl >/dev/null 2>&1; then _get() { curl -fsSL --proto '=https' --retry 2 "$1" -o "$2"; } elif command -v wget >/dev/null 2>&1; then _get() { wget -q -O "$2" "$1"; } else all_say "ALL needs curl or wget." "ALL necesita curl o wget." >&2; exit 1 fi if command -v sha256sum >/dev/null 2>&1; then _sha() { sha256sum "$1" | awk '{print $1}'; } else _sha() { shasum -a 256 "$1" | awk '{print $1}'; }; fi _tty='' if ( : /dev/null; then _tty=/dev/tty; fi TMP="$(mktemp -d "${TMPDIR:-/tmp}/all-oneline.XXXXXX")" trap 'rm -rf "$TMP"' EXIT trap 'exit 130' INT trap 'exit 143' TERM printf '\n ALL - Universal Computer MCP\n\n' # ---- email + six-digit code (0.7.4) ---- all_spaces() { _sp=''; _n="$1"; while [ "$_n" -gt 0 ]; do _sp="$_sp "; _n=$((_n - 1)); done; printf '%s' "$_sp"; } _cY=''; _cR=''; _cM=''; _cB=''; _cX=''; _bY='' if [ -t 1 ] && [ -z "${NO_COLOR:-}" ] && [ "${TERM:-}" != dumb ]; then _cY="$(printf '\033[38;5;178m')"; _cR="$(printf '\033[38;5;167m')"; _cM="$(printf '\033[38;5;245m')" _cB="$(printf '\033[1m')"; _cX="$(printf '\033[0m')"; _bY="$(printf '\033[48;5;220m\033[38;5;232m\033[1m')" fi all_problem() { if [ "$ALL_LANG" = es ]; then printf '%s\n' " $_cR$2$_cX" >&2; else printf '%s\n' " $_cR$1$_cX" >&2; fi; } all_hint() { if [ "$ALL_LANG" = es ]; then printf '%s\n' " $_cM$2$_cX"; else printf '%s\n' " $_cM$1$_cX"; fi; } all_json_str() { sed -n 's/.*"'"$1"'"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$2" 2>/dev/null | head -n 1; } all_json_num() { sed -n 's/.*"'"$1"'"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p' "$2" 2>/dev/null | head -n 1; } all_json_ok() { grep -q '"ok"[[:space:]]*:[[:space:]]*true' "$1" 2>/dev/null; } all_json_true() { grep -Eq "\"$1\"[[:space:]]*:[[:space:]]*true" "$2" 2>/dev/null; } if command -v curl >/dev/null 2>&1; then _post() { curl -sS --proto '=https' --max-time 30 -H 'Content-Type: application/json' --data "$2" -o "$3" "$1" 2>/dev/null && [ -s "$3" ]; } _quick() { curl -fsS --proto '=https' --max-time 5 -o "$2" "$1" 2>/dev/null && [ -s "$2" ]; } elif command -v wget >/dev/null 2>&1; then _post() { wget -q --content-on-error -O "$3" --header='Content-Type: application/json' --post-data="$2" "$1" 2>/dev/null; [ -s "$3" ]; } _quick() { wget -q -T 5 -t 1 -O "$2" "$1" 2>/dev/null && [ -s "$2" ]; } else _post() { return 1; } _quick() { return 1; } fi # What the site offers right now. The email option (and the words about the free trial) exist only while the trial, its owner-only # test mode or email activation is switched on. With all of them off, or when the site cannot be asked, this script asks for the # license link with exactly the question and the words it always had. _opts_done=''; _email_on=''; _trial_on='' all_options() { if [ -n "$_opts_done" ]; then return 0; fi _opts_done=1 if _quick "$SITE/api/trial/status" "$TMP/status"; then if all_json_true enabled "$TMP/status"; then _email_on=1; _trial_on=1; fi if all_json_true allowlist "$TMP/status"; then _email_on=1; fi if all_json_true email_activation "$TMP/status"; then _email_on=1; fi fi return 0 } all_card_machine() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× ESTA COMPUTADORA YA USÓ SU PRUEBA${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} La prueba gratis es una por computadora. Para usar ALL aquí, ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} elige un plan en all-mcp.fyi (hasta 3 computadoras por ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} licencia). No se instaló nada. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× THIS COMPUTER ALREADY USED ITS TRIAL${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} The free trial is one per computer. To use ALL here, choose ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} a plan at all-mcp.fyi (up to 3 computers per license). ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Nothing was installed. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_elsewhere() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× ESTE CORREO YA PROBÓ EN OTRA COMPUTADORA${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Tu prueba quedó atada a otra computadora. Para usar ALL en ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} esta, elige un plan: incluye hasta 3 computadoras. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× THIS EMAIL ALREADY TRIED ALL ON ANOTHER COMPUTER${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Your trial is tied to another computer. To use ALL on this ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} one, choose a plan: it includes up to 3 computers. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_ended() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× TU PRUEBA YA TERMINÓ${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Elige un plan para seguir; se activa en esta misma ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} computadora sin reinstalar. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× YOUR TRIAL HAS ALREADY ENDED${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Choose a plan to keep going; it activates on this same ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} computer without reinstalling. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_ended_plain() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× TU PRUEBA YA TERMINÓ${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Elige un plan en all-mcp.fyi para seguir. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× YOUR TRIAL HAS ALREADY ENDED${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Choose a plan at all-mcp.fyi to keep going. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_inactive() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× ESTA LICENCIA NO ESTÁ ACTIVA${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Revísala en tu página de licencia; si todo se ve bien, ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} escríbele al soporte de ALL desde ahí. No se instaló nada. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× THIS LICENSE IS NOT ACTIVE${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Check it on your license page; if it looks right, write to ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ALL support from there. Nothing was installed. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_full() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× ESTA LICENCIA YA USA TODAS SUS COMPUTADORAS${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Libera una computadora en tu página de licencia (botón ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Quitar) y vuelve a ejecutar el comando. No se instaló nada. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cR}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}${_cB}× THIS LICENSE ALREADY USES ALL ITS COMPUTERS${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} Free a computer on your license page (Remove button), then ${_cR}│${_cX}" printf '%s\n' " ${_cR}│${_cX} run the command again. Nothing was installed. ${_cR}│${_cX}" printf '%s\n' " ${_cR}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } all_card_check_email() { if [ "$ALL_LANG" = es ]; then printf '%s\n' "" printf '%s\n' " ${_cY}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}${_cB}◆ REVISA TU CORREO${_cX} ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}│${_cX}" printf '%s%s%s%s\n' " ${_cY}│${_cX} ${_cM}Correo ${_cX}" "$1" "$(all_spaces $((51 - ${#1})))" " ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cM}Vale ${_cX}10 minutos · 5 intentos ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} Te enviamos un código de 6 dígitos. Escríbelo abajo. ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ¿No llega? Escribe r para reenviarlo (desde 60 s). ${_cY}│${_cX}" printf '%s\n' " ${_cY}╰────────────────────────────────────────────────────────────────╯${_cX}" else printf '%s\n' "" printf '%s\n' " ${_cY}╭────────────────────────────────────────────────────────────────╮${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}${_cB}◆ CHECK YOUR EMAIL${_cX} ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}│${_cX}" printf '%s%s%s%s\n' " ${_cY}│${_cX} ${_cM}Email ${_cX}" "$1" "$(all_spaces $((52 - ${#1})))" " ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cM}Valid ${_cX}10 minutes · 5 attempts ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} We sent you a 6-digit code. Type it below. ${_cY}│${_cX}" printf '%s\n' " ${_cY}│${_cX} Not arriving? Type r to resend (after 60 s). ${_cY}│${_cX}" printf '%s\n' " ${_cY}╰────────────────────────────────────────────────────────────────╯${_cX}" fi } # The sentence for an email that has no membership: the free trial is only offered while it is open to everyone. all_no_membership() { if [ -n "$_trial_on" ]; then all_problem "That email has no ALL membership. Try 3 hours free at all-mcp.fyi/trial or paste your license link." "Ese correo no tiene una membresía de ALL. Prueba 3 horas gratis en all-mcp.fyi/es/prueba o pega tu enlace de licencia."; else all_problem "That email has no ALL membership. Check it, or paste your license link." "Ese correo no tiene una membresía de ALL. Revísalo o pega tu enlace de licencia."; fi } # $1 = the upgrade link the site sent (may be empty). The personal link converts the trial in place, so only then does the card say # "it activates on this same computer"; otherwise the plain card and the general plans page. all_show_ended() { _ul='' if printf '%s' "$1" | grep -Eq '^https://all-mcp\.fyi/upgrade/[A-Za-z0-9_?=&#./%-]*$'; then _ul="$1"; fi if [ -n "$_ul" ]; then all_card_ended >&2 else all_card_ended_plain >&2 if [ "$ALL_LANG" = es ]; then _ul='https://all-mcp.fyi/es/#buy-all'; else _ul='https://all-mcp.fyi/#buy-all'; fi fi printf ' %s%s%s %s%s%s\n' "$_cM" "$(if [ "$ALL_LANG" = es ]; then printf 'Planes:'; else printf 'Plans:'; fi)" "$_cX" "$_cY" "$_ul" "$_cX" >&2 } # The same fingerprint install.py sends (installers/install.py machine_hash: SHA-256 of "all-trial-machine-v1||"; the # hardware id is IOPlatformUUID or /etc/machine-id). It is only compared by the site, never stored: it is what lets a finished # trial's own computer get its personal upgrade link. Empty (and then not sent) when the system does not expose the id. all_machine_hash() { _mraw=''; _mos='' case "$(uname -s 2>/dev/null)" in Darwin) _mos=macos; _mraw="$(ioreg -rd1 -c IOPlatformExpertDevice 2>/dev/null | awk -F'"' '/IOPlatformUUID/ { print $4; exit }')" ;; Linux) _mos=linux for _mf in /etc/machine-id /var/lib/dbus/machine-id; do if [ -r "$_mf" ]; then _mraw="$(head -n 1 "$_mf" 2>/dev/null | tr -d '[:space:]')"; fi if [ -n "$_mraw" ]; then break; fi done ;; esac if [ -z "$_mraw" ]; then return 0; fi if command -v sha256sum >/dev/null 2>&1; then _mh="$(printf '%s' "all-trial-machine-v1|$_mos|$_mraw" | sha256sum | awk '{print $1}')" elif command -v shasum >/dev/null 2>&1; then _mh="$(printf '%s' "all-trial-machine-v1|$_mos|$_mraw" | shasum -a 256 | awk '{print $1}')" else return 0; fi if printf '%s' "$_mh" | grep -Eq '^[a-f0-9]{64}$'; then printf '%s' "$_mh"; fi } all_send_code() { # The site decides whether a code goes out (no membership, a finished trial, a cooldown...): this line only says the question is # being asked. The CHECK YOUR EMAIL card is what says a code was sent, and it appears only when one really was. all_hint "Checking $_masked…" "Comprobando $_masked…" _mjson='' _mval="$(all_machine_hash 2>/dev/null || true)" if [ -n "$_mval" ]; then _mjson=",\"machine\":\"$_mval\""; fi if ! _post "$SITE/api/activate/start" "{\"email\":\"$_em\",\"locale\":\"$ALL_LANG\",\"purpose\":\"activation\"$_mjson}" "$TMP/start"; then all_problem "ALL could not reach its activation service right now." "ALL no pudo contactar su servicio de activación en este momento." return 1 fi if all_json_ok "$TMP/start" && ! grep -q '"sent"[[:space:]]*:[[:space:]]*false' "$TMP/start"; then _sends=$((_sends + 1)); _sent_at="$(date +%s)" return 0 fi case "$(all_json_str error "$TMP/start")" in no_membership) all_no_membership ;; invalid_email) all_problem "That email does not look right. Check it and try again." "Ese correo no parece válido. Revísalo e inténtalo de nuevo." ;; rate_limited) all_problem "Too many codes requested. Wait a few minutes and try again." "Se pidieron demasiados códigos. Espera unos minutos e inténtalo de nuevo." ;; cooldown) all_problem "A code was just sent to that email. Check your inbox, or wait a minute and try again." "Ya se envió un código a ese correo. Revisa tu bandeja de entrada o espera un minuto e inténtalo de nuevo." ;; disabled) all_problem "Email activation is not available right now. Paste your license link instead." "La activación por correo no está disponible ahora. Pega tu enlace de licencia." ;; too_many_attempts|locked) all_problem "Too many attempts. Ask for a new code in a few minutes." "Demasiados intentos. Pide un código nuevo en unos minutos." ;; trial_ended) all_show_ended "$(all_json_str upgrade_url "$TMP/start")"; exit 1 ;; license_inactive) all_card_inactive >&2; exit 1 ;; *) all_problem "ALL could not send a code right now. Try again in a few minutes." "ALL no pudo enviar un código ahora. Inténtalo de nuevo en unos minutos." ;; esac return 1 } # $1 = what was typed (it contains an @). Success: sets _c to the activation claim and returns 0. Return 1: ask for the link or the # email again. A final no (this computer or email already used its trial, license not active) prints a card and exits. all_email_claim() { # Only the blanks around the address and ONE surrounding <...> pair are dropped; words are never glued together. _em="$(printf '%s' "$1" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/^<\(.*\)>$/\1/' | tr 'A-Z' 'a-z')" if ! printf '%s' "$_em" | grep -Eq "^[a-z0-9._%+'-]{1,64}@[a-z0-9.-]{1,190}\.[a-z]{2,24}$"; then all_problem "That email does not look right. Check it and try again." "Ese correo no parece válido. Revísalo e inténtalo de nuevo." return 1 fi if [ -z "$_tty" ]; then all_problem "No terminal to type the code: run the command in a terminal." "No hay una terminal para escribir el código: ejecuta el comando en una terminal."; exit 1; fi _masked="$(printf '%s' "$_em" | sed 's/^\(.\)[^@]*@/\1***@/')" _sends=0; _sent_at=0; _wrong=0; _entries=0 all_send_code || return 1 all_card_check_email "$_masked" while [ "$_entries" -lt 14 ]; do _entries=$((_entries + 1)) if [ "$ALL_LANG" = es ]; then printf '%s' " Código: "; else printf '%s' " Code: "; fi IFS= read -r _in &2; exit 1 ;; email_used_elsewhere) all_card_elsewhere >&2; exit 1 ;; trial_ended) all_show_ended "$(all_json_str upgrade_url "$TMP/verify")"; exit 1 ;; license_inactive) all_card_inactive >&2; exit 1 ;; no_seat) all_card_full >&2; exit 1 ;; no_membership) all_no_membership; return 1 ;; rate_limited) all_problem "Too many codes requested. Wait a few minutes and try again." "Se pidieron demasiados códigos. Espera unos minutos e inténtalo de nuevo." ;; *) all_problem "ALL could not check the code right now. Try again in a moment." "ALL no pudo comprobar el código ahora. Inténtalo de nuevo en un momento." ;; esac done all_hint "Nothing was installed. Run the command again when you have your license link or your email at hand." "No se instaló nada. Vuelve a ejecutar el comando cuando tengas a mano tu enlace de licencia o tu correo." return 1 } unset ALL_ACTIVATION_SOURCE _code="${ALL_LICENSE:-${1:-}}" _claim='' _tries=0 while [ -z "$_claim" ]; do if [ -z "$_code" ]; then _tries=$((_tries + 1)) if [ -z "$_tty" ]; then all_say "No terminal to ask for the license: run it in a terminal (or pass the code in ALL_LICENSE)." \ "No hay una terminal para pedir la licencia: ejecútalo en una terminal (o pasa el código en ALL_LICENSE)." >&2 exit 1 fi all_options if [ "$_tries" -gt 3 ]; then if [ -n "$_email_on" ]; then all_say " Nothing was installed. Run the command again when you have your license link or your email at hand." " No se instaló nada. Vuelve a ejecutar el comando cuando tengas a mano tu enlace de licencia o tu correo." >&2 else all_say " Nothing was installed. Run the command again when you have your license link at hand." " No se instaló nada. Vuelve a ejecutar el comando cuando tengas a mano tu enlace de licencia." >&2 fi exit 1 fi if [ -n "$_email_on" ]; then if [ "$ALL_LANG" = es ]; then printf '%s' " Pega tu enlace de licencia o escribe tu correo: "; else printf '%s' " Paste your license link or type your email: "; fi else if [ "$ALL_LANG" = es ]; then printf '%s' " Pega tu enlace o código de licencia: "; else printf '%s' " Paste your license link or code: "; fi fi IFS= read -r _code /dev/null && grep -q '"ok":true' "$TMP/check"; then _claim="$_c" else all_say " That link or code is not valid or its license is not active. Copy it again from your license page." \ " Ese enlace o código no es válido o su licencia no está activa. Cópialo de nuevo desde tu página de licencia." >&2 _code='' if [ -n "${ALL_LICENSE:-${1:-}}" ] && [ -z "$_tty" ]; then exit 1; fi fi fi done export ALL_INSTALL_CLAIM="$_claim" # Right after a release the CDN can briefly serve the new manifest next to # the previous launcher (or the reverse): retry before calling it a failure. _ok='' for _try in 1 2 3; do _get "$SITE/downloads/manifest.json?t=$_try$$" "$TMP/manifest.json" _want="$(awk -v f="\"$_file\"" 'index($0, f) { hit = 1 } hit && /"sha256"/ { gsub(/[^a-f0-9]/, "", $2); print $2; exit }' "$TMP/manifest.json")" _get "$SITE/downloads/$_file?t=$_try$$" "$TMP/$_file" if [ -n "$_want" ] && [ "$(_sha "$TMP/$_file")" = "$_want" ]; then _ok=1; break; fi sleep 15 done if [ -z "$_ok" ]; then all_say "ALL could not verify the official installer. Nothing was changed; try again in a minute." \ "ALL no pudo verificar el instalador oficial. No se cambió nada; inténtalo de nuevo en un minuto." >&2 exit 1 fi # This terminal stays open, so the launcher does not ask to press Enter. export ALL_NO_PAUSE=1 _rc=0 if [ -n "$_tty" ]; then "$_shell" "$TMP/$_file"