利用shell脚本写文件

需求

自定义 mongodb 配置,希望原生离线安装启动,使用该配置

在离线安装服务的过程时,自动生成配置文件并启动该服务

写配置文件

echo "[+] 开始写配置文件"

cat > /etc/mongodb/conf/mongodb.conf << EOF
systemLog:
  destination: file
  path: /data/mongodb/log/mongodb.log
  logAppend: true
storage:
  dbPath: /data/mongodb
  engine: wiredTiger
  journal:
    enabled: true
net:
  bindIp: 0.0.0.0
  port: 27017
processManagement:
  fork: true
EOF

echo "[+] 结束写配置文件"

猜你喜欢

转载自blog.csdn.net/u012206617/article/details/134999972
今日推荐