Files
gotelegram_pro/install_by_key.sh

23 lines
1.1 KiB
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
# Установка по ключу «в ссылке»: одна команда с токеном.
# Вариант 1 — подставьте свой GITHUB_TOKEN в команду и дайте её клиенту:
# GITHUB_TOKEN=ghp_ВАШ_ТОКЕН bash -c 'curl -sL https://raw.githubusercontent.com/anten-ka/gotelegram_pro/main/install_by_key.sh | sudo -E bash'
# Вариант 2 — если этот файл выложен в публичный Gist, «ссылка» будет короче (см. INSTALL_LINK.md).
set -e
REPO="${GOTETELEGRAM_REPO:-https://github.com/anten-ka/gotelegram_pro.git}"
BRANCH="${GIT_BRANCH:-main}"
DIR="/tmp/gotelegram_pro_$$"
trap "rm -rf $DIR" EXIT
if [ -z "$GITHUB_TOKEN" ]; then
echo "Задайте GITHUB_TOKEN. Пример:"
echo " GITHUB_TOKEN=ghp_xxx curl -sL ВАША_ССЫЛКА | sudo -E bash"
exit 1
fi
echo "[*] Клонирование репозитория..."
git clone --depth 1 --branch "$BRANCH" "https://${GITHUB_TOKEN}@${REPO#https://}" "$DIR"
echo "[*] Запуск установки..."
exec sudo -E "$DIR/install_gotelegram_bot.sh"