Modify sed
flag based on OS. Closes #1474.
Co-authored-by: Holden Moreland <holden@hdmoreland.com>
This commit is contained in:
parent
25513b8104
commit
e317f2c5ff
1 changed files with 5 additions and 4 deletions
9
install-prod.sh
Normal file → Executable file
9
install-prod.sh
Normal file → Executable file
|
@ -10,6 +10,7 @@ RED="$(tput setaf 1 2>/dev/null || printf '')"
|
|||
BLUE="$(tput setaf 4 2>/dev/null || printf '')"
|
||||
GREEN="$(tput setaf 2 2>/dev/null || printf '')"
|
||||
NO_COLOR="$(tput sgr0 2>/dev/null || printf '')"
|
||||
SED_INPLACE=$(if [[ "$(uname)" == "Darwin" ]]; then echo "-i ''"; else echo "-i"; fi)
|
||||
|
||||
info() {
|
||||
printf '%s\n' "${BLUE}> ${NO_COLOR} $*"
|
||||
|
@ -96,15 +97,15 @@ modify_config(){
|
|||
|
||||
info "modifying config.toml"
|
||||
# Replace `db.host=localhost` with `db.host=db` in config file.
|
||||
sed -i "s/host = \"localhost\"/host = \"listmonk_db\"/g" config.toml
|
||||
sed $SED_INPLACE "s/host = \"localhost\"/host = \"listmonk_db\"/g" config.toml
|
||||
# Replace `db.password=listmonk` with `db.password={{db_password}}` in config file.
|
||||
# Note that `password` is wrapped with `\b`. This ensures that `admin_password` doesn't match this pattern instead.
|
||||
sed -i "s/\bpassword\b = \"listmonk\"/password = \"$db_password\"/g" config.toml
|
||||
sed $SED_INPLACE "s/\bpassword\b = \"listmonk\"/password = \"$db_password\"/g" config.toml
|
||||
# Replace `app.address=localhost:9000` with `app.address=0.0.0.0:9000` in config file.
|
||||
sed -i "s/address = \"localhost:9000\"/address = \"0.0.0.0:9000\"/g" config.toml
|
||||
sed $SED_INPLACE "s/address = \"localhost:9000\"/address = \"0.0.0.0:9000\"/g" config.toml
|
||||
|
||||
info "modifying docker-compose.yml"
|
||||
sed -i "s/POSTGRES_PASSWORD=listmonk/POSTGRES_PASSWORD=$db_password/g" docker-compose.yml
|
||||
sed $SED_INPLACE "s/POSTGRES_PASSWORD=listmonk/POSTGRES_PASSWORD=$db_password/g" docker-compose.yml
|
||||
}
|
||||
|
||||
run_migrations(){
|
||||
|
|
Loading…
Reference in a new issue