Files
ports/security/zenmap/files/pc-su
Rusmir Dusko 861373e04b - Update to 6.40
- Change maintainer email gmx.ch --> FreeBSD.org
- Add desktop dependency
- Trim dependency for python
- Add OPTIONS_SUB
- Trim NLS
- Trim files/pc-su to newest from PC-BSD

Approved by:	wg/pawel (mentors)
2013-09-14 12:35:26 +00:00

35 lines
797 B
Bash

#!/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 qsudo first, should always be the default
which qsudo >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
qsudo $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