dockamole/mole/start.sh

24 lines
599 B
Bash
Raw Normal View History

2019-06-24 21:43:17 +00:00
#! /bin/bash
# Executes mole using local and remotes from env variables
local_remote=""
for i in `seq ${MAX_TUNNELS:-10}`; do
local_name=MOLE_LOCAL_$i
remote_name=MOLE_REMOTE_$i
if [ ! -z "${!local_name}" ] && [ ! -z "${!remote_name}" ]; then
local_remote="$local_remote -local ${!local_name} -remote ${!remote_name}"
fi
done
if [ -z "$local_remote" ]; then
echo "Must provide at least one local and remote via MOLE_LOCAL_1 and MOLE_REMOTE_1"
exit 1
fi
2019-06-24 19:46:33 +00:00
mole -v \
2019-06-24 21:43:17 +00:00
$local_remote \
2019-06-24 19:46:33 +00:00
-server ${MOLE_SERVER} \
2019-06-24 21:43:17 +00:00
-key ${SSH_KEY:-~/.ssh/id_rsa} \
2019-06-24 19:46:33 +00:00
-insecure