aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/dnsmasq/files/dnsmasq.init
diff options
context:
space:
mode:
authorAlberto Bursi <alberto.bursi@outlook.it>2017-05-02 19:31:17 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-05-04 23:10:09 +0200
commit7296767639b511ab96ca2847ffad84dd4c37452d (patch)
tree797ea7222c6dc70b4f5d73cc1a26b88f69e23469 /package/network/services/dnsmasq/files/dnsmasq.init
parentcd5cd7c859660a52a09d6744a4343e3078a8c883 (diff)
downloadupstream-7296767639b511ab96ca2847ffad84dd4c37452d.tar.gz
upstream-7296767639b511ab96ca2847ffad84dd4c37452d.tar.bz2
upstream-7296767639b511ab96ca2847ffad84dd4c37452d.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/services/dnsmasq/files/dnsmasq.init')
-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 e6ba7322e3..3b801303b5 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -762,7 +762,7 @@ dnsmasq_start()
append_bool "$cfg" dbus "--enable-dbus"
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"