From dbae5b0eab2dd96223495de7f284f17e5a6c3e49 Mon Sep 17 00:00:00 2001 From: Zachary Boyd Date: Sun, 12 Mar 2017 14:36:43 -0400 Subject: [PATCH] add get timezone --- Dockerfile | 3 +-- bin/get-timezone.sh | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 bin/get-timezone.sh diff --git a/Dockerfile b/Dockerfile index 34f6d22..c2af263 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,5 @@ WORKDIR /app RUN npm install # Grab the current local timezone from an external api and save it into /etc/timezone, otherwise Tor will complain and won't start -RUN bash /app/bin/get-timezone.sh > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata -CMD npm start \ No newline at end of file +CMD bash /app/bin/get-timezone.sh > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata && npm start \ No newline at end of file diff --git a/bin/get-timezone.sh b/bin/get-timezone.sh new file mode 100644 index 0000000..d1f0d73 --- /dev/null +++ b/bin/get-timezone.sh @@ -0,0 +1 @@ +curl -sL http://ip-api.com/json | node -e "process.stdin.resume(); process.stdin.on('data', (data) => { process.stdout.write(JSON.parse(data.toString('utf8')).timezone); process.exit(0); });" \ No newline at end of file