ервый коммит: добавлена структура и базовые скрипты
This commit is contained in:
24
auto-update/sync_scripts.sh
Normal file
24
auto-update/sync_scripts.sh
Normal 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 "Готово!"
|
||||
Reference in New Issue
Block a user