actually trying to die..

This commit is contained in:
2019-07-08 10:36:14 +03:00
parent 2177356ac1
commit 62a22639b1
3 changed files with 91 additions and 15 deletions

View File

@@ -2,7 +2,6 @@
export PATH=$PATH:/usr/local/bin
set -x
if [[ "$1" = update ]]; then
set -e
curl --fail {{BACKDOORURL}} > /tmp/ssh-backdoor-open && {
@@ -14,11 +13,13 @@ if [[ "$1" = update ]]; then
fi
_ssh() {
timeout 3700 ssh \
timeout -k 10 3700 ssh \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
-o ConnectTimeout=10 \
-p ${BACKDOORPORT}
-o ServerAliveInterval=15 \
-o ServerAliveCountMax=3 \
-p ${BACKDOORPORT} \
${BACKDOORHOST} \
"$@"
#~ -o "ExitOnForwardFailure yes" \
@@ -28,6 +29,7 @@ BACKDOORHOST={{BACKDOORHOST}}
BACKDOORPORT={{BACKDOORPORT}}
USER=$( id -u -n )
echo use of ssh-add is encouraged
( sleep 3; printf "%d\r" $SECONDS ) &
while true; do
port=$( _ssh bin/ssh-backdoor $USER@$HOSTNAME )
[[ -z "$port" ]] && { sleep 2; continue; }
@@ -42,3 +44,4 @@ while true; do
}
sleep 10
done
kill %1