24 lines
692 B
Bash
24 lines
692 B
Bash
#!/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 "Готово!" |