Merge pull request #4179 from EricLuehrsen/unbound_cpnodashu
unbound: support copy without dash update
This commit is contained in:
commit
0f908ec064
2 changed files with 25 additions and 6 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=unbound
|
PKG_NAME:=unbound
|
||||||
PKG_VERSION:=1.6.1
|
PKG_VERSION:=1.6.1
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_LICENSE:=BSD-3-Clause
|
PKG_LICENSE:=BSD-3-Clause
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
|
@ -88,6 +88,29 @@ UNBOUND_CONTROL_CFG="$UNBOUND_CONTROL -c $UNBOUND_CONFFILE"
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
copy_dash_update() {
|
||||||
|
# TODO: remove this function and use builtins when this issues is resovled.
|
||||||
|
# Due to OpenWrt/LEDE divergence "cp -u" isn't yet universally available.
|
||||||
|
local filetime keeptime
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f $UNBOUND_KEYFILE.keep ] ; then
|
||||||
|
# root.key.keep is reused if newest
|
||||||
|
filetime=$( date -r $UNBOUND_KEYFILE +%s )
|
||||||
|
keeptime=$( date -r $UNBOUND_KEYFILE.keep +%s )
|
||||||
|
|
||||||
|
|
||||||
|
if [ $keeptime -gt $filetime ] ; then
|
||||||
|
cp $UNBOUND_KEYFILE.keep $UNBOUND_KEYFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
rm -f $UNBOUND_KEYFILE.keep
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
create_interface_dns() {
|
create_interface_dns() {
|
||||||
local cfg="$1"
|
local cfg="$1"
|
||||||
local ipcommand logint ignore ifname ifdashname
|
local ipcommand logint ignore ifname ifdashname
|
||||||
|
@ -312,11 +335,7 @@ unbound_mkdir() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f $UNBOUND_KEYFILE.keep ] ; then
|
copy_dash_update
|
||||||
# root.key.keep is reused if newest
|
|
||||||
cp -u $UNBOUND_KEYFILE.keep $UNBOUND_KEYFILE
|
|
||||||
rm -f $UNBOUND_KEYFILE.keep
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Ensure access and prepare to jail
|
# Ensure access and prepare to jail
|
||||||
|
|
Loading…
Reference in a new issue