ервый коммит: добавлена структура и базовые скрипты

This commit is contained in:
2026-04-13 23:19:45 +03:00
commit 3af65c3be8
3 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Замени Tvoi_Login на свой логин в Gitea
REPO_URL="https://gitlab.alex2py.ru/Tvoi_Login/server-tools.git"
DEST_DIR="/opt/server-tools"
echo "Запуск синхронизации скриптов..."
if ! command -v git &> /dev/null; then
echo "Ошибка: Git не установлен."
exit 1
fi
if [ ! -d "$DEST_DIR" ]; then
echo "Клонирую репозиторий..."
git clone "$REPO_URL" "$DEST_DIR"
else
echo "Обновляю репозиторий..."
cd "$DEST_DIR" || exit
git reset --hard HEAD
git pull origin main
fi
find "$DEST_DIR/bash" -type f -name "*.sh" -exec chmod +x {} \;
echo "Готово!"