Created
June 23, 2025 05:49
-
-
Save orion55/37ca3559d4ffc5bfa8f2dc4912f5c14e to your computer and use it in GitHub Desktop.
Создание сессии tmux с 3 окнами
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
| #!/usr/local/bin/bash | |
| SESSION_NAME="aster_env" | |
| # Проверяем и завершаем существующую сессию если есть | |
| if tmux has-session -t "$SESSION_NAME" >/dev/null 2>&1; then | |
| echo "Обнаружена существующая сессия '$SESSION_NAME' - завершаем..." | |
| tmux kill-session -t "$SESSION_NAME" | |
| fi | |
| # Создаем новую сессию | |
| tmux new-session -d -s "$SESSION_NAME" -n src -c /usr/local/etc/asterisk | |
| # Создаем окно для Asterisk с запуском команды | |
| tmux new-window -d -t "$SESSION_NAME" -n asterisk -c /usr/local/etc/asterisk | |
| tmux send-keys -t "$SESSION_NAME":asterisk "asterisk -rvvvv" C-m | |
| # Создаем дополнительное окно | |
| tmux new-window -d -t "$SESSION_NAME" -n misc -c /usr/local/etc/asterisk | |
| tmux select-window -t "$SESSION_NAME":asterisk | |
| # Подключаемся к сессии | |
| tmux attach -t "$SESSION_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment