initialize msva in Xsession based on monkeysphere.conf instead of /etc/X11/Xsession.d
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 12 Mar 2010 07:25:07 +0000 (02:25 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 12 Mar 2010 07:25:07 +0000 (02:25 -0500)
packaging/debian/70monkeysphere_use_validation_agent

index 1390859792f3805422fd761b3a10644767f17bd5..7c7a0304d54d3ac14d41d6d6ce1b78348c64bd9e 100644 (file)
@@ -4,9 +4,9 @@
 # startup argument with a monkeysphere-validation-agent nested
 # process, if available and none already exist.
 
-# Enable this system-wide by adding a line to
-# /etc/X11/Xsession.options that reads:
-# use-monkeysphere-validation-agent
+# Enable this system-wide by setting
+# MONKEYSPHERE_USE_VALIDATION_AGENT=true in
+# /etc/monkeysphere/monkeysphere.conf
 
 # Note that there is some weird interaction between this and
 # dbus-session at the moment: dbus-launch can start the msva just
 
 STARTMSVA=
 MSVAGENT=/usr/bin/monkeysphere-validation-agent
-
-if grep -qs ^use-monkeysphere-validation-agent "$OPTIONFILE"; then
-  if [ -x "$MSVAGENT" ] && [ -z "$MONKEYSPHERE_VALIDATION_AGENT_SOCKET" ]; then
-    STARTUP="$MSVAGENT $STARTUP"
-  fi
+MSSYSCONFIG=/etc/monkeysphere/monkeysphere.conf
+MSUSERCONFIG="$HOME/.monkeysphere/monkeysphere.conf"
+
+if [ -x "$MSVAGENT" ] ; then
+    USEMSVAGENT=$(sh -c "
+. '$MSSYSCONFIG' 2>/dev/null
+. '$MSUSERCONFIG' 2>/dev/null || :
+printf '%s' "'"$MONKEYSPHERE_USE_VALIDATION_AGENT"')
+    
+    if [ "$USEMSVAGENT" == "true" ] ; then
+        STARTUP="$MSVAGENT $STARTUP"
+    fi
 fi