summaryrefslogtreecommitdiffstats
path: root/ktsuss/gksu
blob: fb6626ad73ea7b63255a522fad8f9c94a32b2cee (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
COMMAND="$(echo "${@}" | tr -d "\'\"")"
BIN="$(echo "${1}" | cut -d" " -f1)"
KTSUSS="/usr/libexec/ktsuss -u root"
export PATH="${PATH}:/sbin:/usr/sbin"
[ "$(id -u)" = "0" ] && KTSUSS=""
[ -x "${BIN}" ] && exec ${KTSUSS} ${COMMAND}
for path in $(echo ${PATH} | sed -e 's/:/ /g') ; do
    [ -x "${path}/${BIN}" ] && exec ${KTSUSS} ${path}/${COMMAND}
done