Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leonzdev committed Mar 8, 2020
0 parents commit 1cd3309
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y curl gnupg bash squid

# zerotier
RUN curl -s https://install.zerotier.com | bash

# ZeroTier relies on UDP port 9993
EXPOSE 9993/udp

RUN mkdir -p /var/lib/zerotier-one

COPY ./main.sh /main.sh
RUN chmod 0755 /main.sh

ENTRYPOINT ["/main.sh"]

20 changes: 20 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# start zerotier service
zerotier-one -d

# start squid
squid

while sleep 60; do
ps aux | grep zerotier |grep -q -v grep
PROCESS_1_STATUS=$?
ps aux |grep squid |grep -q -v grep
PROCESS_2_STATUS=$?
# If the greps above find anything, they exit with 0 status
# If they are not both 0, then something is wrong
if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 ]; then
echo "One of the processes has already exited."
exit 1
fi
done

0 comments on commit 1cd3309

Please sign in to comment.