From 858ec5b78570ff8b5bfc8e0fdd41305a0626f4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=D0=BA=D0=B0?= Date: Fri, 20 Feb 2026 21:13:22 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20galias-d.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- galias-d.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/galias-d.sh b/galias-d.sh index 9516580..5c7abb7 100644 --- a/galias-d.sh +++ b/galias-d.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -x +# set -x # Цвета для вывода RED='\033[0;31m' @@ -10,11 +10,11 @@ BLUE='\033[0;34m' NC='\033[0m' # No Color # Форматирование текста -function msgerr() +function msgerr() # Вывод сообщения с ошибкой { echo -e "${RED}$1${NC}" } -function msgok() +function msgok() # Сообщение с успешным выполнением { echo -e "${GREEN}$1${NC}" } @@ -25,10 +25,23 @@ function msgpr() msgpr "hey! this is talias-d!" -msgerr "hey! this is ERROR!" -msgok "hey! this is OK!" + + check_apt() { sudo apt install $1 -y } +## ИИ +find_public_keys() { + local keys=() + + if [[ -d "$SSH_DIR" ]]; then + # Ищем все .pub файлы в директории .ssh + while IFS= read -r -d '' key_file; do + keys+=("$key_file") + done < <(find "$SSH_DIR" -maxdepth 1 -name "*.pub" -type f -print0 2>/dev/null) + fi + + printf '%s\n' "${keys[@]}" +} \ No newline at end of file