Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic restarting on failure #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add automatic restarting
  • Loading branch information
DeflateAwning committed Apr 4, 2024
commit 6ccb2d9d753f77c6a70ea00fe50fcf8bbf82c586
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
FROM alpine

COPY sockd.sh /usr/local/bin/
COPY entrypoint.sh /

RUN true \
&& apk add --update-cache dante-server openvpn bash openresolv openrc \
Expand All @@ -18,7 +19,4 @@ RUN true \

COPY sockd.conf /etc/

ENTRYPOINT [ \
"/bin/bash", "-c", \
"cd /etc/openvpn && /usr/sbin/openvpn --config *.conf --script-security 2 --up /usr/local/bin/sockd.sh" \
]
ENTRYPOINT [ "/entrypoint.sh" ]
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

cd /etc/openvpn

while true; do
echo "Starting OpenVPN"
/usr/sbin/openvpn --config *.conf --script-security 2 --up /usr/local/bin/sockd.sh || true
echo "OpenVPN exited. Trying again in 1 second."
sleep 1
done