summaryrefslogtreecommitdiffstats
path: root/extra/ktsuss/gksu
blob: e905e2589a28026f0be26a0b8810f1abfbf0bb6b (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