david/sshbackup
david
/
sshbackup
Archived
1
0
Fork 0

changed amirootcheck

This commit is contained in:
Dominik Danter 2013-07-01 09:45:31 -05:00
parent fb54ab876c
commit 92f99edb13
1 changed files with 4 additions and 2 deletions

View File

@ -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