From 86f9878b126114aa03dc1e55e9b8186c9f1b2940 Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 13 May 2018 21:04:26 -0700 Subject: [PATCH] Allow time for socket to set up before changing permisisons --- ssh-tunnel-manager.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ssh-tunnel-manager.sh b/ssh-tunnel-manager.sh index 7924f6e..4739b15 100755 --- a/ssh-tunnel-manager.sh +++ b/ssh-tunnel-manager.sh @@ -40,6 +40,14 @@ version=0.7 # "" #) +# +# The SOCKETS_PERMS array is used to configure permissions for forwarded sockets. +# +#SOCKETS_PERMS=( +# "" +# "" +#) + # # The RECONNECT_TIMER is used in case of a tunnel connection to be lost. After # the script is detecting that the connection was lost, the time defined the @@ -429,7 +437,9 @@ case $COMMAND in echotime "START - Starting tunnel '${TUNNEL_NAMES[$idx]}' (ID $idx) ... PID: $RESULT_PID" echo "Starting tunnel '${TUNNEL_NAMES[$idx]}' ... Done" + sleep "0.2" if [ -e "${SOCKETS[$idx]}" ]; then + echo "Setting socket permissions to ${SOCKETS_PERMS[$idx]}" chmod ${SOCKETS_PERMS[$idx]} ${SOCKETS[$idx]} fi fi -- GitLab