aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/avahi/avahi.inc19
-rw-r--r--config/avahi/avahi.xml3
2 files changed, 10 insertions, 12 deletions
diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc
index e82e7db3..2c1ce25f 100644
--- a/config/avahi/avahi.inc
+++ b/config/avahi/avahi.inc
@@ -1,6 +1,6 @@
<?php
-/*
+/*
$Id$
avahi.inc
part of pfSense (http://www.pfSense.com)
@@ -40,18 +40,21 @@ function stop_avahi() {
function setup_avahi() {
global $g, $config;
+ // Make image RW
+ conf_mount_rw();
+
// Extract out libraries and avahi-daemon
if(file_exists("/tmp/avahi.tgz")) {
exec("/usr/bin/tar xzPf /tmp/avahi.tgz -C /");
unlink("/tmp/avahi.tgz");
}
-
+
// Make sure everthing was extracted
if(!file_exists("/usr/local/sbin/avahi-daemon")) {
log_error("Sorry, something went wrong while extract avahi binaries. Please try the operation again");
return;
}
-
+
// Pull some various values out of config.xml
$hostname = $config['system']['hostname'];
$domain = $config['system']['domain'];
@@ -60,14 +63,14 @@ function setup_avahi() {
$denyif = $config['installedpackages']['avahi']['config'][0]['denyinterfaces'];
// Is package disabled?
- if(!$enable) {
+ if ((!$enable) && file_exists("/usr/local/etc/rc.d/avahi-daemon.sh")) {
stop_avahi();
return;
}
// Add needed users and groups
exec("/usr/sbin/pw useradd avahi");
- exec("/usr/sbin/pw groupadd avahi");
+ exec("/usr/sbin/pw groupadd avahi");
// No supplied domains? Use the defaults.
if(!$browsedomains)
@@ -90,7 +93,7 @@ function setup_avahi() {
$avahiconfig = <<<EOF
# avahi.conf - This file was automatically generated by the pfSense pacakge
-# manager. Do not edit this file, it will be overwritten automatically.
+# manager. Do not edit this file, it will be overwritten automatically.
# See /usr/local/pkg/avahi.inc to make changes to this file!
[server]
@@ -137,8 +140,6 @@ rlimit-nproc=3
EOF;
- // Make image RW
- conf_mount_rw();
/* Write out .conf file */
safe_mkdir("/usr/local/etc/avahi");
$fd = fopen("/usr/local/etc/avahi/avahi-daemon.conf", "w");
@@ -151,7 +152,7 @@ EOF;
$start .= " mount -t procfs procfs /proc\n";
$start .= "fi\n";
$start .= "/usr/local/sbin/avahi-daemon -D\n";
- $start .= "/etc/rc.conf_mount_ro\n";
+ $start .= "/etc/rc.conf_mount_ro\n";
$stop = "/usr/bin/killall avahi-daemon";
write_rcfile(array(
"file" => "avahi-daemon.sh",
diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml
index 3670e7d6..21d60576 100644
--- a/config/avahi/avahi.xml
+++ b/config/avahi/avahi.xml
@@ -86,9 +86,6 @@
<multiple>true</multiple>
</field>
</fields>
- <custom_add_php_command>
- setup_avahi();
- </custom_add_php_command>
<custom_php_install_command>
exec("mkdir -p /usr/local/etc/avahi/services/");
exec("mv /usr/local/etc/avahi/*.service /usr/local/etc/avahi/services/");