From 88c4caddfc59fcd15576625620e872e0a8e0ed6b Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 5 Dec 2015 03:35:19 +0100 Subject: Add missing includes, fix service handling --- config/avahi/avahi.inc | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc index 04f3b343..cd7099cf 100644 --- a/config/avahi/avahi.inc +++ b/config/avahi/avahi.inc @@ -28,6 +28,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +require_once('config.inc'); +require_once('interfaces.inc'); +require_once('service-utils.inc'); +require_once('util.inc'); + $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); if ($pfs_version == "2.1" || $pfs_version == "2.2") { define('AVAHI_BASE', '/usr/pbi/avahi-' . php_uname("m")); @@ -63,8 +68,7 @@ function avahi_deinstall() { } function avahi_write_config() { - global $config, $avahi_config; - conf_mount_rw(); + global $config; // Pull some various values out of config.xml if (isset($config['installedpackages']['avahi']['config'][0])) { @@ -173,8 +177,16 @@ EOF; $fd = fopen(AVAHI_BASE . "/etc/avahi/avahi-daemon.conf", "w"); fwrite($fd, $avahiconfig); fclose($fd); +} + +function avahi_write_rcfile() { + global $config; + if (isset($config['installedpackages']['avahi']['config'][0])) { + $avahi_config = $config['installedpackages']['avahi']['config'][0]; + } else { + $avahi_config = array(); + } - /* Write out rc.d startup file */ $start = "/etc/rc.conf_mount_rw\n"; $start .= "if [ ! -d /proc/0 ]; then\n"; $start .= " /bin/mkdir -p /proc\n"; @@ -214,20 +226,26 @@ EOF; ) ); - conf_mount_ro(); } function avahi_sync() { global $config; + conf_mount_rw(); if (is_service_running("avahi")) { stop_service("avahi"); } avahi_write_config(); + // Is package enabled? if ($config['installedpackages']['avahi']['config'][0]['enable']) { + avahi_write_rcfile(); start_service("avahi"); + } else { + unlink_if_exists("/usr/local/etc/rc.d/avahi-daemon.sh"); } + + conf_mount_ro(); } function avahi_upgrade_config() { -- cgit v1.2.3 From 29a89b5e56c79caf4d487265dbe11a83ad93ca1d Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 5 Dec 2015 03:37:15 +0100 Subject: Fix menu item URL, bump version --- config/avahi/avahi.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml index a69c515d..9bdb9c7f 100644 --- a/config/avahi/avahi.xml +++ b/config/avahi/avahi.xml @@ -44,20 +44,18 @@ Services: Avahi avahi - 1.10.1 - Save + 1.10.4 /usr/local/pkg/avahi.inc Avahi - Modify avahi settings.
Services
- pkg_edit.php?xml=avahi.xml + /pkg_edit.php?xml=avahi.xml
avahi avahi-daemon.sh avahi-daemon - Avahi zeroconf/mDNS daemon + Avahi Zeroconf/mDNS Daemon /usr/local/pkg/ -- cgit v1.2.3 From ed8c7dfe264ba98ce8a3389bb41c80a32f4724b4 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 5 Dec 2015 03:38:24 +0100 Subject: Bump avahi package version --- pkg_config.10.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 20de98f8..91f18c7f 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -273,12 +273,13 @@ net/avahi-app devel/dbus avahi-0.6.31-##ARCH##.pbi - 1.10.3 + 1.10.4 BETA 2.2 https://packages.pfsense.org/packages/config/avahi/avahi.xml avahi.xml Please visit Services - Avahi menu, enable the service and select which interfaces you do NOT wish Avahi to listen on. Save settings to start the service. + 2.2.999 ntop -- cgit v1.2.3 From 12ac1afd13822593f9b75b6546f444f5a50d9b38 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 5 Dec 2015 03:39:32 +0100 Subject: Bump avahi package version --- pkg_config.8.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 6d8b27d6..c71e4442 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -303,8 +303,8 @@ avahi-app-0.6.29_1.tbz avahi-0.6.31-i386.pbi - 0.6.31 pkg v1.10.3 - ALPHA + 0.6.31 pkg v1.10.4 + BETA 1.2.3 https://packages.pfsense.org/packages/config/avahi/avahi.xml avahi.xml -- cgit v1.2.3 From 29ed4e8e0067a3e1d2281eaa7fbef6d84f27e694 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 5 Dec 2015 03:40:14 +0100 Subject: Bump avahi package version --- pkg_config.8.xml.amd64 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 7302dfd1..307bf4fd 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -303,8 +303,8 @@ avahi-0.6.29.tbz avahi-0.6.31-amd64.pbi - 0.6.31 pkg v1.10.3 - ALPHA + 0.6.31 pkg v1.10.4 + BETA 1.2.3 https://packages.pfsense.org/packages/config/avahi/avahi.xml avahi.xml -- cgit v1.2.3