diff options
Diffstat (limited to 'config/avahi/avahi.inc')
-rw-r--r-- | config/avahi/avahi.inc | 19 |
1 files changed, 10 insertions, 9 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", |