Skip to content

Commit

Permalink
added checking for timezone in env files
Browse files Browse the repository at this point in the history
  • Loading branch information
gcgarner committed Nov 13, 2019
1 parent ed7cc47 commit 164c165
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .templates/nodered/nodered.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#none
#TZ=timezone
1 change: 1 addition & 0 deletions .templates/nodered/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
build: ./services/nodered/.
restart: unless-stopped
user: "0"
env_file: ./services/nodered/nodered.env
ports:
- 1880:1880
volumes:
Expand Down
14 changes: 14 additions & 0 deletions menu.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

#timezones
timezones() {

env_file=$1
TZ=$(cat /etc/timezone)

#test for TZ=
[ $(grep "TZ=" $env_file) ] && sed -i "/TZ=/c\TZ=$TZ" $env_file

}

#future function add password in build phase
password_dialog() {
while [[ "$passphrase" != "$passphrase_repeat" || ${#passphrase} -lt 8 ]]; do
Expand Down Expand Up @@ -53,6 +64,9 @@ function yml_builder() {
rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh'
fi

#if an env file exists check for timezone
[ -f "./services/$1/$1.env" ] && timezones ./services/$1/$1.env

cat $service >>docker-compose.yml

#test for post build
Expand Down

0 comments on commit 164c165

Please sign in to comment.