#!/bin/sh # /usr/bin/gksu: gksu-polkit wrapper PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin" help() { cat <<- EOF Usage: gksu [OPTION] command Run a command as another user OPTIONS: -h, --help Show this help EOF } case $1 in -h | --help | "" ) help exit ;; * ) ;; esac if [ -x /usr/sbin/$1 ]; then CMD="/usr/sbin/$@" elif [ -x /usr/bin/$1 ]; then CMD="/usr/bin/$@" elif [ -x /usr/bin/$1 ]; then CMD="/usr/local/bin/$@" elif [ -x /usr/local/sbin/$1 ]; then CMD="/usr/local/sbin/$@" elif [ -x /sbin/$1 ]; then CMD="/sbin/$@" elif [ -x /bin/$1 ]; then CMD="/bin/$@" else CMD="$@" fi if [ -x "`type -path gksu-polkit`" ]; then GKSU_POLKIT="`type -path gksu-polkit` " else echo "$(basename $0): \`gksu-polkit' command not found" exit 1 fi eval "$GKSU_POLKIT" "$CMD"