commit
6d3a508dbf
|
@ -69,8 +69,10 @@ preflight()
|
||||||
{
|
{
|
||||||
|
|
||||||
#amiroot?
|
#amiroot?
|
||||||
if [ $(whoami) != "root" ]; then
|
# Thhis is a safter way of testing this
|
||||||
echo "aborting mission. you must be root."
|
# 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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in New Issue