Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tunnels working smooth

  • Loading branch information...
commit 036240ef9c4f58f77881e42f36826fb6e36a4324 1 parent eb0a08f
@tomas tomas authored
Showing with 8 additions and 8 deletions.
  1. +4 −4 core/actions
  2. +1 −1  core/functions
  3. +2 −2 lib/tunnel.sh
  4. +1 −1  prey.sh
View
8 core/actions
@@ -71,7 +71,7 @@ check_running_actions(){
fi
local action_name=`basename $pidfile | sed -e 's/prey-action-//' -e 's/\.pid//'`
- log " -- Found pid for running action: $action_name"
+ log " -- Found PID for running action: $action_name"
local pid=`cat $pidfile`
local actually_running=`ps ax | grep $pid | grep -v grep > /dev/null && echo 1`
@@ -81,7 +81,7 @@ check_running_actions(){
unload_action $action_name
sleep 1
elif [ -z "$actually_running" ]; then
- log " -- Not really running! Pidfile was just lying around."
+ log " -- Not really running! PID file was just lying around."
rm -f "$pidfile"
else
add_running_action $action_name $pid
@@ -104,9 +104,9 @@ run_pending_actions(){
# -b -> Cause the status of terminated background jobs to be reported immediately,
# rather than before printing the next primary prompt.
# -m job control enabled
- # set -bm
+ set -bm
- log "\n${bold} >> Running pending actions...${bold_end}"
+ log "\n${bold} >> Running pending actions...${bold_end}\n"
for action in "${actions[@]}"; do
local current_module=`echo $action | sed 's/=.*//'`
View
2  core/functions
@@ -268,7 +268,7 @@ open_reverse_tunnel(){
if [ ! -f "$tmpbase/prey-tunnel-${local_tunnel_port}.pid" ]; then
log " -- Opening reverse tunnel from ${local_tunnel_port} to ${remote_tunnel_port} as ${remote_tunnel_user} on ${remote_tunnel_host}..."
- setsid "$base_path/lib/tunnel.sh" ${remote_tunnel_host} ${local_tunnel_port} ${remote_tunnel_port} ${remote_tunnel_user} ${remote_tunnel_pass}
+ setsid "$base_path/lib/tunnel.sh" ${remote_tunnel_host} ${local_tunnel_port} ${remote_tunnel_port} ${remote_tunnel_user} ${remote_tunnel_pass} &> /dev/null
if [ -f "prey-tunnel.pid" ]; then
mv "prey-tunnel.pid" "$tmpbase/prey-tunnel-${local_tunnel_port}.pid"
log " -- Tunnel open and ready to serve!"
View
4 lib/tunnel.sh
@@ -37,9 +37,9 @@ fi
ssh -N -o 'ExitOnForwardFailure=yes' -R ${3}:localhost:${2} ${4}@${1} &
tunnel_pid=$!
-sleep 5
+sleep 3
if [ "`ps -p $tunnel_pid | grep $tunnel_pid`" ]; then
echo "$tunnel_pid" > "prey-tunnel.pid"
fi
-# cleanup_tunnel
+cleanup_tunnel
View
2  prey.sh
@@ -151,4 +151,4 @@ else
cleanup
fi
-exit 0
+# exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.