瀏覽代碼

Only remove motd instructions once

Bob Mottram 7 年之前
父節點
當前提交
bd86c4b19a
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      src/freedombone-utils-setup

+ 3
- 1
src/freedombone-utils-setup 查看文件

@@ -379,7 +379,9 @@ function mark_admin_user_account {
379 379
 }
380 380
 
381 381
 function remove_instructions_from_motd {
382
-    sed -i '/## /d' /etc/motd
382
+    if grep -q "## " /etc/motd; then
383
+        sed -i '/## /d' /etc/motd
384
+    fi
383 385
 }
384 386
 
385 387
 function remove_default_user {