head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2013.01.11.21.16.59;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/310248
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r310248 | rm | 2013-01-11 20:22:28 +0000 (Fri, 11 Jan 2013) | 8 lines
## SVN ##
## SVN ## - drop PKGNAMEPREFIX (it's an app, not library)
## SVN ## - replace su-to-zenmap.sh (su detection script) with more clean solution
## SVN ##   from PC-BSD, that does not require modification to work properlt with kde4
## SVN ## - bump PORTREVISION
## SVN ##
## SVN ## PR:		175120
## SVN ## Submitted by:	nemysis <nemysis@@gmx.ch> (maintainer)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@#!/bin/sh
# Wrapper script which finds the right "su" program
# to use for graphical root execution

if [ `id -r -u` != "0" ] ; then
        VARS="`echo $@@`"

        # Try qsu first, should always be the default
        which qsu >/dev/null 2>/dev/null
        if [ $? -eq 0 ] ; then
           qsu $VARS
           exit $?
        fi

        # Now try gksu
        which gksu >/dev/null 2>/dev/null
        if [ $? -eq 0 ] ; then
           gksu -a "$VARS"
           exit $?
        fi

        # Lastly we have kdesu
        which kdesu >/dev/null 2>/dev/null
        if [ $? -eq 0 ] ; then
           kdesu -t -c "$VARS"
           exit $?
        fi

        # If no utility could be found...
        echo "No graphical switch-user utility found!"
        exit 1
else
        ${@@}
fi
@
