commit
6d3a508dbf
|
@ -69,8 +69,10 @@ preflight()
|
|||
{
|
||||
|
||||
#amiroot?
|
||||
if [ $(whoami) != "root" ]; then
|
||||
echo "aborting mission. you must be root."
|
||||
# Thhis is a safter way of testing this
|
||||
# See: http://askubuntu.com/questions/30148/how-can-i-determine-whether-a-shellscript-runs-as-root-or-not/
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "aborting mission, you must be root."
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
Reference in New Issue