Sfoglia il codice sorgente

Only remove motd instructions once

Bob Mottram 7 anni fa
parent
commit
bd86c4b19a
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3
    1
      src/freedombone-utils-setup

+ 3
- 1
src/freedombone-utils-setup Vedi File

379
 }
379
 }
380
 
380
 
381
 function remove_instructions_from_motd {
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
 function remove_default_user {
387
 function remove_default_user {