opnsense-ports/security/zenmap/files/pc-su
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

34 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