aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorAlberto Bursi <alberto.bursi@outlook.it>2017-05-02 19:31:17 +0200
committerJo-Philipp Wich <jo@mein.io>2017-06-02 00:09:14 +0200
commit9e20cc56b9a7244b14a5aa8d807148a619339103 (patch)
treec84c662f2fa4b6a0eace5e6d94f8e1de99f324a8 /package/network
parentebf46d2c5bd3c4f1ff80544a134f87131e011056 (diff)
downloadupstream-9e20cc56b9a7244b14a5aa8d807148a619339103.tar.gz
upstream-9e20cc56b9a7244b14a5aa8d807148a619339103.tar.bz2
upstream-9e20cc56b9a7244b14a5aa8d807148a619339103.zip
dnsmasq: make tftp root if not existing
If there's a TFTP root directory configured, create it with mkdir -p (which does not throw an error if the folder exists already) before starting dnsmasq. This is useful for TFTP roots in /tmp, for example. Originally submitted by nfw user aka Nathaniel Wesley Filardo Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index cce7558fc9..5b4de32181 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -581,7 +581,7 @@ dnsmasq_start()
append_bool "$cfg" boguspriv "--bogus-priv"
append_bool "$cfg" expandhosts "--expand-hosts"
config_get tftp_root "$cfg" "tftp_root"
- [ -d "$tftp_root" ] && append_bool "$cfg" enable_tftp "--enable-tftp"
+ [ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
append_bool "$cfg" nonwildcard "--bind-dynamic"
append_bool "$cfg" fqdn "--dhcp-fqdn"