Initial commit

This commit is contained in:
Taras Masnyk 2024-03-31 18:35:59 +03:00
commit 32b0a9574f
3 changed files with 35 additions and 0 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
#
# Dockerfile for openconnect-arm
#
FROM arm32v7/alpine:latest
RUN set -xe \
&& apk add --no-cache nettle \
&& apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ \
openconnect \
&& mkdir -p /etc/openconnect \
&& touch /etc/openconnect/openconnect.conf
COPY scripts/connect.sh /root
RUN chmod +x /root/connect.sh
HEALTHCHECK --start-period=15s --retries=1 \
CMD pgrep openconnect || exit 1; pgrep dnsmasq || exit 1
CMD ["sh" , "-c", "sh /root/connect.sh -D && ip addr && sh && tail -f /dev/null"]

6
scripts/connect.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
echo ${ANYCONNECT_PASSWORD} |openconnect ${ANYCONNECT_SERVER} --user=${ANYCONNECT_USER} --authgroup=DEV ${ANYCONNECT_KEY} -i tun127 -b
sleep 5
iptables -t nat -A POSTROUTING -o tun127 -j MASQUERADE
/bin/sh

6
scripts/connect.sh.bak Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
echo ${ANYCONNECT_PASSWORD} |openconnect ${ANYCONNECT_SERVER} --user=${ANYCONNECT_USER} --authgroup=DEV -i tun127 -b
sleep 5
iptables -t nat -A POSTROUTING -o tun127 -j MASQUERADE
/bin/sh