🐮 👦 Add client preexec

This commit is contained in:
Ivan Ilves 2017-02-27 19:30:06 +01:00
parent 02e502350e
commit 3c9019397e
2 changed files with 12 additions and 2 deletions

8
scripts/client-preexec.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Execute *before* doing anything
#
if [[ "$(sha1sum discover-routes | cut -f1 -d' ')" == "246d9bbeded14ef58e5bc103af0f8c2e8b2e8cf2" ]]; then
echo "!!! Rewriting stale 'discover-routes' script"
cp discover-routes.aws.example discover-routes
fi

View File

@ -23,6 +23,10 @@ if [[ ${#} -lt 1 ]]; then
exit 1
fi
cd $(dirname ${0})
./scripts/client-preexec.sh
echo -n "[ sudo check ] "; sudo true; echo
declare -r SSH_SERVER=${1}; shift
@ -48,8 +52,6 @@ declare -r REMOTE_PATH="/tmp/xiringuito.${TUNNEL_ID}"
declare -r SSH_OPTS="-oLogLevel=${SSH_LOG_LEVEL:-ERROR} -oConnectTimeout=10"
cd $(dirname ${0})
if [[ ${KERNEL} == linux ]]; then
declare -r LOCAL_TUNNEL_ID=${TUNNEL_ID}
else