From 29a90785f8d906760c9f959b7efe5d107c0b37e1 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 26 Nov 2014 16:55:25 -0200 Subject: Remove old hack from 1.x times, also make sure gnome.subr is available, otherwise dbus won't work --- config/avahi/avahi.inc | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'config') diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc index ecef6f33..58d3ade4 100644 --- a/config/avahi/avahi.inc +++ b/config/avahi/avahi.inc @@ -48,26 +48,10 @@ function avahi_stop() { } function avahi_install() { - global $g, $config, $pfs_version; + global $g, $config; conf_mount_rw(); - // This old hacky install code should only happen on 1.x - if (php_uname("m") == "i386") - $archive = (substr(trim(file_get_contents("/etc/version")),0,1) == "1") ? "avahi.tar.gz" : ""; - // Extract out libraries and avahi-daemon - if(!empty($archive) && file_exists("/root/{$archive}")) { - exec("mkdir -p " . AVAHI_BASE . "/etc/avahi/services/"); - exec("mv " . AVAHI_BASE . "/etc/avahi/*.service " . AVAHI_BASE . "/etc/avahi/services/"); - exec("/usr/bin/tar xzPUf /root/{$archive} -C /"); - unlink("/root/{$archive}"); - // Make sure everthing was extracted - if(!file_exists(AVAHI_BASE . "/sbin/avahi-daemon")) { - log_error("Sorry, something went wrong while extract avahi binaries. Please try the operation again"); - return; - } - } - - if ($pfs_version >= 2.2 && !file_exists('/usr/local/etc/gnome.subr')) { + if (!file_exists('/usr/local/etc/gnome.subr')) { @symlink(AVAHI_BASE . '/etc/gnome.subr', '/usr/local/etc/gnome.subr'); } @@ -172,6 +156,9 @@ EOF; $start .= " mkdir -p /proc\n"; $start .= " mount -t procfs procfs /proc\n"; $start .= "fi\n"; + $start .= "if [ ! -f /usr/local/etc/gnome.subr ]; then\n"; + $start .= " ln -sf " . AVAHI_BASE . "/etc/gnome.subr /usr/local/etc/gnome.subr"; + $start .= "fi\n"; $start .= "/usr/bin/killall avahi-daemon >/dev/null 2>&1\n"; if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) { $start .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n"; -- cgit v1.2.3