source: src-sh/pc-su/pc-su @ 1620346

9.1-release9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 12 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100644
File size: 740 bytes
Line 
1#!/bin/sh
2# Wrapper script which finds the right "su" program
3# to use for graphical root execution
4
5if [ `id -r -u` != "0" ] ; then
6        VARS="`echo $@`"
7       
8        # Try qsu first, should always be the default
9        which qsu >/dev/null 2>/dev/null
10        if [ $? -eq 0 ] ; then
11           qsu $VARS
12           exit $? 
13        fi
14
15        # Now try gksu
16        which gksu >/dev/null 2>/dev/null
17        if [ $? -eq 0 ] ; then
18           gksu -a "$VARS"
19           exit $? 
20        fi
21
22        # Lastly we have kdesu
23        which kdesu >/dev/null 2>/dev/null
24        if [ $? -eq 0 ] ; then
25           kdesu -t -c "$VARS"
26           exit $? 
27        fi
28       
29        # If no utility could be found...
30        echo "No graphical switch-user utility found!"
31        exit 1
32else
33        ${@}
34fi
Note: See TracBrowser for help on using the repository browser.