瀏覽代碼

Configure dns

Bob Mottram 11 年之前
父節點
當前提交
dfe1a07f73
共有 1 個檔案被更改,包括 15 行新增0 行删除
  1. 15
    0
      install-freedombone.sh

+ 15
- 0
install-freedombone.sh 查看文件

219
   echo 'regenerate_ssh_keys' >> $COMPLETION_FILE
219
   echo 'regenerate_ssh_keys' >> $COMPLETION_FILE
220
 }
220
 }
221
 
221
 
222
+function configure_dns {
223
+  if grep -Fxq "configure_dns" $COMPLETION_FILE; then
224
+	  return
225
+  fi
226
+  if ! grep -Fxq "nameserver 213.73.91.35" /etc/resolv.conf; then
227
+    echo 'nameserver 213.73.91.35' >> /etc/resolv.conf
228
+  fi
229
+  if ! grep -Fxq "nameserver 85.214.20.141" /etc/resolv.conf; then
230
+    echo 'nameserver 85.214.20.141' >> /etc/resolv.conf
231
+  fi
232
+  echo 'configure_dns' >> $COMPLETION_FILE
233
+}
234
+
222
 function set_your_domain_name {
235
 function set_your_domain_name {
223
   if grep -Fxq "set_your_domain_name" $COMPLETION_FILE; then
236
   if grep -Fxq "set_your_domain_name" $COMPLETION_FILE; then
224
 	  return
237
 	  return
225
   fi
238
   fi
226
   echo "$DOMAIN_NAME" > /etc/hostname
239
   echo "$DOMAIN_NAME" > /etc/hostname
227
   hostname $DOMAIN_NAME
240
   hostname $DOMAIN_NAME
241
+  sed -i "s/127.0.1.1       arm/127.0.1.1       $DOMAIN_NAME/g" /etc/hosts
228
   echo "127.0.1.1  $DOMAIN_NAME" >> /etc/hosts
242
   echo "127.0.1.1  $DOMAIN_NAME" >> /etc/hosts
229
   echo 'set_your_domain_name' >> $COMPLETION_FILE
243
   echo 'set_your_domain_name' >> $COMPLETION_FILE
230
 }
244
 }
847
 
861
 
848
 argument_checks
862
 argument_checks
849
 remove_proprietary_repos
863
 remove_proprietary_repos
864
+configure_dns
850
 initial_setup
865
 initial_setup
851
 install_editor
866
 install_editor
852
 change_login_message
867
 change_login_message