From 9787e951717134ddd2b7e198a7a009a5c15d1723 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 Jan 2015 11:19:24 +0000 Subject: [PATCH] Allow DNS nameservers to be configured --- man/freedombone.1.gz | Bin 3543 -> 3572 bytes src/freedombone | 30 ++++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/man/freedombone.1.gz b/man/freedombone.1.gz index 0a018b5a9dea78a31b33a762d5ebcdc5df9c5607..6d7ee05f6ca7543f1619e58fcf38d5b728285a81 100644 GIT binary patch literal 3572 zcmVx%|YZq7xsIhTu-@V{WL)`D6au3;&&!k(lW(+%}Tq?wU<7@PD#;e z6xEg%Jv%JTW#gg_?SY@@MC&Fy3wU zPh(kT(g-_xJ3mP>UEBR)gG*rhi$Nf;_CuOraeKY`teOn>&ME;?pSKFN{{B1~u~vD~ z*iOWlTty2tD>ZOkHarnMk6)+vX-!$TXxKm0UzNYkv#Y9g7B5thRKtg^VgK-4Cd<&| z>0>#5TsAz#i@|u4!Zd5Tu%jTy1TYk#nDhg|qqHjW*xO3$c^yR5uu{1ZS+R_Kg)dTV zY9mKQw15V%6Wa~<*Y6Q4K*^sn;57+b=c60J-P_SLx3SKduiCB=|Ae9dG&iq8pr#d!tEj zI5=ob=CaZ1_^jQC)p8kPva>GDLJK1(+iZNs3!%s5Y9WopP}wY91CZx?3`c1y!^|+- z05$PE1;4ISs3fF~fjgh92_zRXO5wYHf>u-65Qk}gpfa)@(X*i3ShXy*zL7c@R%*8y+lXaM5H;5$1h3Q{0m1}4Q zry%V=ggH)Sbc<-_rTADt2=3%(r6bWoKFE#16=yu?8UT&d|)ir!DzNU>qEpDTh|P9Nf5(_BvQ8JQL#r=CP#Te4R7~N^}v= ziE}RcgEk3xwFsf@LW3!wBtnwXbf^s(E^Lk_@tU_ebdsNmD+PpeFS9i5PNZyw0BxPY z3RzS*VQ&n*{&GDU@vzE{_#lJ{AfRbflYn4_nr-NB`oD;=7B4zb*|Jp6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^yFf`k+QMAr6(wfbvicsd^?RVxxxDM5)f~(@!d@p6!K|#J z90AY=8zQ!iA1XXgWIwe1hOH;McHge2z1rt$ENJKE5;Be@f0hl4IixX^d;C{r#bKf~ z()+5{JG~l?50JBl;#wI4wiAC3Rrq7BLS>Rjw~G6gQU7SP!n`rM935VcF3&`_eR^`- zeRINZJBeA*H8^hG%?X R+_!#K<3EMEhF=sU004C6@0|bu diff --git a/src/freedombone b/src/freedombone index 996aa33d..178cb7a4 100755 --- a/src/freedombone +++ b/src/freedombone @@ -81,6 +81,10 @@ LOCAL_NETWORK_STATIC_IP_ADDRESS="192.168.1.60" # IP address of the router (gateway) ROUTER_IP_ADDRESS="192.168.1.254" +# DNS +NAMESERVER1='213.73.91.35' +NAMESERVER2='85.214.20.141' + # whether to route outgoing traffic through Tor ROUTE_THROUGH_TOR="no" @@ -375,6 +379,8 @@ function show_help { echo ' --cjdns Enable CJDNS' echo ' --vpass VoIP server password' echo ' --vport VoIP server port' + echo ' --ns1 First DNS nameserver' + echo ' --ns2 Second DNS nameserver' echo '' echo 'system types' echo '------------' @@ -1047,6 +1053,16 @@ case $key in shift VOIP_PORT=$1 ;; + # DNS Nameserver 1 + --ns1) + shift + NAMESERVER1=$1 + ;; + # DNS Nameserver 2 + --ns2) + shift + NAMESERVER2=$1 + ;; *) # unknown option ;; @@ -1099,9 +1115,15 @@ function read_configuration { fi if [ -f $CONFIGURATION_FILE ]; then + if grep -q "NAMESERVER1" $CONFIGURATION_FILE; then + NAMESERVER1=$(grep "NAMESERVER1" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "NAMESERVER2" $CONFIGURATION_FILE; then + NAMESERVER2=$(grep "NAMESERVER2" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi if grep -q "DEBIAN_REPO" $CONFIGURATION_FILE; then DEBIAN_REPO=$(grep "DEBIAN_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list." + CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list." fi if grep -q "VOIP_PORT" $CONFIGURATION_FILE; then VOIP_PORT=$(grep "VOIP_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') @@ -1386,7 +1408,7 @@ function install_not_on_BBB { echo " address $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/network/interfaces echo ' netmask 255.255.255.0' >> /etc/network/interfaces echo " gateway $ROUTER_IP_ADDRESS" >> /etc/network/interfaces - echo ' dns-nameservers 213.73.91.35 85.214.20.141' >> /etc/network/interfaces + echo " dns-nameservers $NAMESERVER1 $NAMESERVER2" >> /etc/network/interfaces echo '# Example to keep MAC address between reboots' >> /etc/network/interfaces echo '#hwaddress ether DE:AD:BE:EF:CA:FE' >> /etc/network/interfaces echo '' >> /etc/network/interfaces @@ -4645,8 +4667,8 @@ function configure_dns { fi echo 'domain localdomain' > /etc/resolv.conf echo 'search localdomain' >> /etc/resolv.conf - echo 'nameserver 213.73.91.35' >> /etc/resolv.conf - echo 'nameserver 85.214.20.141' >> /etc/resolv.conf + echo "nameserver $NAMESERVER1" >> /etc/resolv.conf + echo "nameserver $NAMESERVER2" >> /etc/resolv.conf echo 'configure_dns' >> $COMPLETION_FILE }