fix: 更新数据库配置设置
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
|
||||
set -o errexit
|
||||
@@ -12,15 +11,17 @@ set -o pipefail
|
||||
|
||||
# We add the copy from default config in the entrypoint to not break users
|
||||
# case someone mounts a configuration file in /usr/local/etc/omc/default)
|
||||
cp -nr "$BASE_DIR"/default/. "$BASE_DIR"
|
||||
cp -n $BASE_DIR/default/omc.conf $BASE_DIR/omc.conf
|
||||
cp -n $BASE_DIR/default/omc.yaml $BASE_DIR/omc.yaml
|
||||
# cp -n $BASE_DIR/default/sshsvc.yaml $BASE_DIR/sshsvc.yaml
|
||||
|
||||
# Initialize OMC DB
|
||||
if [ ! -f /usr/local/etc/omc/machine.ini ]; then
|
||||
bash /usr/local/etc/omc/script/setup.sh -i -r -m $M_PARAM -c $C_PARAM
|
||||
fi
|
||||
|
||||
# Start Nginx server
|
||||
nginx -g "daemon off;"
|
||||
# Start Nginx server | -s stop
|
||||
nginx
|
||||
|
||||
# Parse CLI flags to pass to the 'omc' call
|
||||
args=("--config" "${BASE_DIR}/omc.yaml")
|
||||
@@ -30,5 +31,5 @@ read -r -a extra_flags <<< "$CMD_EXTRA_FLAGS"
|
||||
# Add flags passed to this script
|
||||
args+=("$@")
|
||||
|
||||
omc --version
|
||||
exec omc "${args[@]}"
|
||||
# Run omc
|
||||
omc "${args[@]}"
|
||||
|
||||
@@ -23,9 +23,9 @@ cp $BASE_DIR/default/omc.yaml $BASE_DIR/omc.yaml
|
||||
sed -i "s/port: 33030/port: $API_HTTP_PORT/" "$BASE_DIR"/omc.yaml
|
||||
sed -i "s/port: 33443/port: $API_HTTPS_PORT/" "$BASE_DIR"/omc.yaml
|
||||
sed -i '/webServer:/,/-/s/^\( *enabled:\) true/\1 false/' "$BASE_DIR"/omc.yaml
|
||||
sed -i '/type: "mysql"/,/-/s/^\( *host:\) "127.0.0.1"/\1 "omc_mariadb"/' "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/host: "127.0.0.1"$/host: "omc_mariadb"/' "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/port: 33066/port: 3306/' "$BASE_DIR"/omc.yaml
|
||||
sed -i '/port: 6379 # Redis port/ {n; s/host: "127.0.0.1"/host: "omc_keydb"/}' "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/host: "127.0.0.1" # Redis host$/host: "omc_keydb" # Redis host/' "$BASE_DIR"/omc.yaml
|
||||
|
||||
# Nginx config
|
||||
sed -i 's/# gzip_/gzip_/' /etc/nginx/nginx.conf
|
||||
|
||||
Reference in New Issue
Block a user