aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-21 17:57:38 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-11-21 17:57:38 -0500
commit970f34cf9da3fa1905e33e18bcb57fc8cbfc453d (patch)
tree03f2f698ba36c4120da51a95b09fe18eb63c8710
parent38ac447b0cd9362f60cc73652defa88f9871bc24 (diff)
downloadpfsense-packages-970f34cf9da3fa1905e33e18bcb57fc8cbfc453d.tar.gz
pfsense-packages-970f34cf9da3fa1905e33e18bcb57fc8cbfc453d.tar.bz2
pfsense-packages-970f34cf9da3fa1905e33e18bcb57fc8cbfc453d.zip
Use unlink_if_exists.
-rw-r--r--config/unbound/unbound.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc
index 6b7080f4..e645e9f1 100644
--- a/config/unbound/unbound.inc
+++ b/config/unbound/unbound.inc
@@ -42,15 +42,20 @@ function unbound_initial_setup() {
exec("/usr/sbin/pw useradd unbound");
// Setup unbound
+ // Create and chown dirs
mwexec("/bin/mkdir -p /usr/local/etc/unbound /usr/local/etc/unbound/dev");
@chown("/usr/local/etc/unbound/.", "unbound");
+ @chown("/usr/local/etc/unbound/dev.", "unbound");
+ // Touch needed files
@touch("/usr/local/etc/unbound/root.hints");
@touch("/usr/local/etc/unbound/root-trust-anchor");
+ // Ensure files and folders belong to unbound
@chown("/usr/local/etc/unbound/root-trust-anchor", "unbound");
@chgrp("/usr/local/etc/unbound/root-trust-anchor", "wheel");
@chmod("/usr/local/etc/unbound/root-trust-anchor", 0600);
- @unlink("/usr/local/etc/unbound/unbound.conf.sample");
- @unlink("/usr/local/etc/rc.d/unbound");
+ // We do not need the sample conf or the default rc.d startup file
+ @unlink_if_exists("/usr/local/etc/unbound/unbound.conf.sample");
+ @unlink_if_exists("/usr/local/etc/rc.d/unbound");
// Setup rc file for startup and shutdown.
unbound_rc_setup();