summaryrefslogtreecommitdiffstats
path: root/extra/ktsuss/gksu
diff options
context:
space:
mode:
Diffstat (limited to 'extra/ktsuss/gksu')
-rw-r--r--extra/ktsuss/gksu11
1 files changed, 11 insertions, 0 deletions
diff --git a/extra/ktsuss/gksu b/extra/ktsuss/gksu
new file mode 100644
index 000000000..e905e2589
--- /dev/null
+++ b/extra/ktsuss/gksu
@@ -0,0 +1,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
+