Update readme, add labs (#82)

Update readme, add labs (#82)
This commit is contained in:
Alexander Tebiev 2026-06-21 18:49:22 +02:00 committed by GitHub
parent 2b4f233d59
commit 3bae6eeb59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 215 additions and 12 deletions

View file

@ -0,0 +1,9 @@
FROM alpine:3.23
RUN apk add --no-cache openssh-client
COPY routeros-init.sh /usr/local/bin/routeros-init
RUN chmod +x /usr/local/bin/routeros-init
ENTRYPOINT ["/usr/local/bin/routeros-init"]

View file

@ -0,0 +1,23 @@
#!/bin/sh
set -eu
deadline="$(($(date +%s) + 120))"
while [ "$(date +%s)" -lt "$deadline" ]; do
if ssh \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o ConnectTimeout=5 \
-o PreferredAuthentications=none \
-o LogLevel=ERROR \
admin@routeros \
"/tool e-mail set server=mailpit port=1025 from=routeros@example.test tls=no"; then
echo "RouterOS e-mail settings applied."
exit 0
fi
sleep 2
done
echo "Timed out waiting for RouterOS SSH." >&2
exit 1