I don't need to be made aware of these files.
This work our script will do for you if you wish.Once the installer is validated, does the user need to install the pre-reqs (like ntp server) before installation?
#!/bin/sh
if [ "$1" = "start" ] || [ "$1" = "restart" ]; then
# Wait for NTP before starting
logger -st "S61unbound" "Waiting for NTP to sync before starting..."
ntptimer=0
while [ "$(nvram get ntp_ready)" = "0" ] && [ "$ntptimer" -lt "300" ]; do
ntptimer=$((ntptimer+1))
sleep 1
done
if [ "$ntptimer" -ge "300" ]; then
logger -st "S61unbound" "NTP failed to sync after 5 minutes - please check immediately!"
echo ""
exit 1
fi
fi
#!/bin/sh
# Copyright (C) 2013-2016 Jeremy Chadwick. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# Waits for ntpc/ntpdate to properly sync time before starting up any
# daemons past this point. The way it works is by repeatedly calling
# /bin/date +%Y and seeing if the year returned is later than 1970.
# Most routers do not have battery-backed RTCs, so their clocks always
# start from the epoch (December 31st 1969). A year later than 1970
# (i.e. 1971 or later) would indicate ntpc has finished.
#
# This is helpful for daemons which are time-sensitive, such as
# BIND/named, where a clock that is extremely skewed can cause errors
# like: checkhints: unable to get root NS rrset from cache: not found
#
# TODO: Implement stop/start/restart/reconfigure/check/kill argument
# support, per rc.unslung. Right now this just runs blindly every
# time. stop/reconfigure/check/kill should be no-ops, start/restart
# should actually do something.
#
NAME="netwait[$$]"
INTERVAL=7
MAXCOUNT=13
checkdate() {
local year=$(/bin/date +%Y)
if [ $year -gt 1970 ]
then
return 0
fi
return 1
}
# First thing we do is check the current date. If the year is
# already compliant, then don't call logger or anything else; just
# exit cleanly immediately.
if checkdate; then
exit 0
fi
# Otherwise use a loop to check things repeatedly and bail out if
# things look good -- or bail out at the very end with a nastygram
# indicating we're not responsible if daemons misbehave past this
# point. :-)
i=1
while [ $i -le $MAXCOUNT ]
do
logger -t $NAME "Waiting for ntpc (attempt ${i}/${MAXCOUNT})"
sleep $INTERVAL
if checkdate; then
logger -t $NAME "Clock synced; good to go!"
exit 0
fi
i=$((i+1))
done
logger -t $NAME "Clock remains unsynced; continuing anyway"
exit 1
sh /jffs/scripts/ChkWAN.sh &
For compatibility reasons, disregard. Remove the DNS redirect option.
and firewall-startCode:iptables -t nat -A PREROUTING -d "$(nvram get lan_ipaddr)" -p tcp --dport 53 -j REDIRECT --to-port 53535;iptables -t nat -A PREROUTING -d "$(nvram get lan_ipaddr)" -p udp --dport 53 -j REDIRECT --to-port 53535
unbound_installer
u = Update (Major) unbound_installer v1.08 -> v1.09
1
sh unbound_installer.sh
unbound: [*] Lock File Detected (firewall) (pid=2236) - Exiting (cpid=16277)
cat /jffs/scripts/firewall-start
#!/bin/sh
sh /jffs/scripts/unbound_installer.sh firewall # unbound Firewall Addition
Not experienced the Lock File issue....does it always happen during the reboot?After successfully installing unbound. I relaunch the installer and return this.
Code:sh unbound_installer.sh
Code:unbound: [*] Lock File Detected (firewall) (pid=2236) - Exiting (cpid=16277)
Code:cat /jffs/scripts/firewall-start #!/bin/sh sh /jffs/scripts/unbound_installer.sh firewall # unbound Firewall Addition
unbound_installer
Nice!unbound_installer
No idea what you mean .@Martineau We're getting there, almost. Adds only the option to check if IPV6 is enabled on the router to fit the unbound.conf file. There are commented lines that should not be commented as to whether IPV6 and Stubby are enabled. I uploaded to Github the startup files of Entware.
Does the memory and CPU performance option work?
This is in unbound.conf because the script understands that the router has IPV6 disabled.No idea what you mean .
#########################################
# integration IPV6
#
# do-ip6: yes
# interface: ::0
# iaccess-control: ::0/0 refuse
# access-control: ::1 allow
# private-address: fd00::/8
# private-address: fe80::/10
#########################################
#########################################
# Options for integration with TCP/TLS Stubby
# udp-upstream-without-downstream: yes
#########################################
#########################################
# integration IPV6
do-ip6: yes
interface: ::0
iaccess-control: ::0/0 refuse
access-control: ::1 allow
private-address: fd00::/8
private-address: fe80::/10
#########################################
#########################################
# Options for integration with TCP/TLS Stubby
udp-upstream-without-downstream: yes
#########################################
unbound-control -c /opt/var/lib/unbound/unbound.conf stats_noreset | grep total.num
Try change directory ownership to nobody, in case you want to drop daemon privileges from root to nobodyhow to get over this error
Connection refused for 127.0.0.1 port 953
using script
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!