소스 검색

Add conditional to avoid errors if nsd exists

Randall Randall 11 년 전
부모
커밋
c7e1e29d
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      scripts/dns.sh

+ 8 - 1
scripts/dns.sh

@@ -9,7 +9,14 @@
 
 # Install nsd, our DNS server software.
 
-useradd nsd
+# ...but first, we have to create the user because the 
+# current Ubuntu forgets to do so in the .deb
+if id nsd > /dev/null 2>&1; then
+	echo "nsd user exists... good";
+else
+	useradd nsd;
+if
+	
 apt-get -qq -y install nsd
 
 # Prepare nsd's configuration.