Last active
July 27, 2025 22:35
-
-
Save Avdushin/e7527505a4da3f071f2bc6637f159910 to your computer and use it in GitHub Desktop.
Скрипт ждёт, пока Steam закончит загружать и устанавливать игру, затем выключает компьютер через 10 секунд.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Ожидание завершения загрузки в Steam..." | |
| while true; do | |
| # Проверяем: | |
| # 1. Нет процессов загрузки Steam. | |
| # 2. Папка downloading пуста. | |
| if ! pgrep -f "steam.*download" >/dev/null && \ | |
| [ -z "$(ls -A ~/.local/share/Steam/steamapps/downloading/ 2>/dev/null)" ]; then | |
| echo "Загрузка завершена. Выключение через 10 секунд..." | |
| sleep 10 | |
| systemctl poweroff | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
*Краткая инструкция
1. Запуск
2. Остановка
3. Проверить работу
nohupдля надёжного фонового выполнения.shutdown.log.pkillилиshutdown -c.