瀏覽代碼

mediagoblin smtp host

Bob Mottram 8 年之前
父節點
當前提交
6593eaf809
共有 1 個檔案被更改,包括 12 行新增0 行删除
  1. 12
    0
      src/freedombone-app-mediagoblin

+ 12
- 0
src/freedombone-app-mediagoblin 查看文件

@@ -411,6 +411,18 @@ function install_mediagoblin {
411 411
     sed -i "s|email_sender_address.*|email_sender_address = \"noreply@${DEFAULT_DOMAIN_NAME}\"|g" $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini
412 412
     sed -i "s|email_sender_address.*|email_sender_address = \"noreply@${DEFAULT_DOMAIN_NAME}\"|g" $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin_local.ini
413 413
 
414
+    if ! grep 'email_smtp_host' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini; then
415
+        sed -i '/email_sender_address/a email_smtp_host = localhost' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini
416
+    else
417
+        sed -i 's|email_smtp_host.*|email_smtp_host = localhost|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini
418
+    fi
419
+
420
+    if ! grep 'email_smtp_host' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin_local.ini; then
421
+        sed -i '/email_sender_address/a email_smtp_host = localhost' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin_local.ini
422
+    else
423
+        sed -i 's|email_smtp_host.*|email_smtp_host = localhost|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin_local.ini
424
+    fi
425
+
414 426
     systemctl enable mediagoblin
415 427
     systemctl daemon-reload
416 428
     systemctl start mediagoblin