Skip to content

Commit

Permalink
added stop.sh script into the example tmux session
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Oct 12, 2023
1 parent 7a53720 commit 060e827
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Absolute path to this script. /home/user/bin/foo.sh
SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /home/user/bin
SCRIPTPATH=`dirname $SCRIPT`
cd "$SCRIPTPATH"

export TMUX_SESSION_NAME=simulation
export TMUX_SOCKET_NAME=mrs

# just attach to the session
tmux -L $TMUX_SOCKET_NAME split-window -t $TMUX_SESSION_NAME
tmux -L $TMUX_SOCKET_NAME send-keys -t $TMUX_SESSION_NAME "sleep 1; tmux list-panes -s -F \"#{pane_pid} #{pane_current_command}\" | grep -v tmux | cut -d\" \" -f1 | while read in; do killp \$in; done; exit" ENTER

0 comments on commit 060e827

Please sign in to comment.