home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
tusportal.tus.k12.pa.us
/
tusportal.tus.k12.pa.us.tar
/
tusportal.tus.k12.pa.us
/
Wyse
/
latest-image.raw
/
0.img
/
usr
/
bin
/
run-admin
< prev
next >
Wrap
Text File
|
2012-08-08
|
516b
|
30 lines
#!/bin/bash
function showError
{
echo $1 >/dev/stderr
zenity --error --text="$1"
}
if test -z $1; then
echo "No command specified."
exit 1
fi
if test `id -u` != "0"; then
showError "You do not have administrator privileges."
exit 1
fi
app=`which $1`
for link in `find /etc/userlevel/admin-apps.d -type l 2>/dev/null`; do
target=`readlink $link`
if test "$target" = "$app"; then
exec "$@"
fi
done
showError "You do not have permission to run application '$1'"
exit 1