7329N/A#!/sbin/sh
7329N/A#
7329N/A# Copyright 2011, 2016, Oracle and/or its affiliates. All rights reserved.
7329N/A#
7329N/A
7329N/A. /lib/svc/share/smf_include.sh
7329N/A
7329N/Acase "$1" in
7329N/A'start')
7329N/A FMRI=svc:/system/consolekit
7329N/A
7329N/A arg=`eval "echo \`svcprop -p consolekit/args $FMRI\`"`
7329N/A
7329N/A SEATFILE=/etc/ConsoleKit/seats.d/00-primary.seat
7329N/A
7329N/A rep=`eval "echo \`svcprop -p consolekit/sessions $FMRI\`"`
7329N/A
7329N/A curline=`sed -n "/Sessions=/p" $SEATFILE`
7329N/A cur=`expr $curline : "Sessions=\(.*\);"`
7329N/A
7329N/A if [[ $cur != $rep ]]; then
7329N/A /usr/bin/ex $SEATFILE << EOF
7329N/A/$curline
7329N/As/$curline/Sessions=$rep;/
7329N/Aw
7329N/Aq
7329N/AEOF
7329N/A fi
7329N/A
7329N/A /usr/sbin/console-kit-daemon $arg
7329N/A
7329N/A rc=$?
7329N/A if [ $rc -ne 0 ]; then
7329N/A echo "$0: consolekit failed with $rc"
7329N/A exit $SMF_EXIT_ERR_FATAL
7329N/A fi
7329N/A ;;
7329N/A
7329N/A*)
7329N/A echo "Usage: $0 { start }"
7329N/A exit $SMF_EXIT_ERR_FATAL
7329N/A ;;
7329N/Aesac
7329N/A
7329N/Aexit $SMF_EXIT_OK