From 060e827eb07ea3384fe52d99047424dbb5fea82d Mon Sep 17 00:00:00 2001 From: devel Date: Thu, 12 Oct 2023 10:23:32 +0200 Subject: [PATCH] added stop.sh script into the example tmux session --- .../tmux/one_drone/stop.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone/stop.sh diff --git a/ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone/stop.sh b/ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone/stop.sh new file mode 100755 index 0000000..28d50b0 --- /dev/null +++ b/ros_packages/mrs_uav_gazebo_simulation/tmux/one_drone/stop.sh @@ -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