Files
galias-d/galias-d.sh

47 lines
909 B
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
# set -x
# Цвета для вывода
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Форматирование текста
function msgerr() # Вывод сообщения с ошибкой
{
echo -e "${RED}$1${NC}"
}
function msgok() # Сообщение с успешным выполнением
{
echo -e "${GREEN}$1${NC}"
}
function msgpr()
{
echo -e "\e[35m$1${NC}"
}
msgpr "hey! this is talias-d!"
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[@]}"
}