]> git.pld-linux.org Git - packages/dbus.git/blobdiff - dbus-daemon-1-profile.d-sh
unfunction is_yes(), moved faster conditions to the front
[packages/dbus.git] / dbus-daemon-1-profile.d-sh
index 5b572f047b914607572f027a756eee3df0dadf36..45fec817fc8cb4cd93cec7345a6ed42f2abdb5d5 100644 (file)
@@ -1,9 +1,11 @@
 #! /bin/sh
 
+[ -x /usr/bin/dbus-launch -a -f /var/run/dbus.pid ] || return
+
 # Get configuration
 . /etc/sysconfig/messagebus
 
-# Take from rc-scripts
+# Taken from rc-scripts
 is_yes()
 {
        # Check value
@@ -19,12 +21,8 @@ is_yes()
        esac
 }
 
-if is_yes "${SESSION_BUS_PROFILE_D}"; then
-    if [ -f /usr/bin/dbus-launch ]; then
-       if [ -f /var/run/dbus.pid ]; then
-           if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
-               eval `dbus-launch --sh-syntax --exit-with-session`
-           fi    
-       fi
-    fi
-fi
\ No newline at end of file
+if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && is_yes "${SESSION_BUS_PROFILE_D}"; then
+       eval `dbus-launch --sh-syntax --exit-with-session`
+fi
+
+unset -f is_yes
This page took 0.0894 seconds and 4 git commands to generate.