File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ LOG_FILE=$(mktemp setup.log.XXXXXX)
2424BASE_COMPOSE_FILE_URL=" https://raw.githubusercontent.com/DefGuard/deployment/main/docker-compose/docker-compose.yaml"
2525BASE_ENV_FILE_URL=" https://raw.githubusercontent.com/DefGuard/deployment/main/docker-compose/.env.template"
2626
27+ if [ " $( uname) " = ' Darwin' ]; then
28+ SED=(sed -i ' ' )
29+ else
30+ SED=(sed -i)
31+ fi
32+
2733# ####################
2834# ## MAIN FUNCTION ###
2935# ####################
@@ -851,7 +857,7 @@ update_env_file() {
851857set_env_file_value () {
852858 # make sure variable exists in file
853859 grep -qF " ${1} =" " ${PROD_ENV_FILE} " || echo " ${1} =" >> " ${PROD_ENV_FILE} "
854- sed -i " s@\(${1} \)=.*@\1=${2} @" " ${PROD_ENV_FILE} "
860+ " ${SED[@]} " " s@\(${1} \)=.*@\1=${2} @" " ${PROD_ENV_FILE} "
855861}
856862
857863set_env_file_secret () {
@@ -863,7 +869,7 @@ set_env_file_password() {
863869}
864870
865871uncomment_feature () {
866- sed -i " s@# \(.*\) # \[${1} \]@\1@" " ${2} "
872+ " ${SED[@]} " " s@# \(.*\) # \[${1} \]@\1@" " ${2} "
867873}
868874
869875enable_enrollment () {
You can’t perform that action at this time.
0 commit comments