david/sshbackup
david
/
sshbackup
Archived
1
0
Fork 0

Merge pull request #8 from foop/patch-1

changed amirootcheck
This commit is contained in:
david 2013-07-01 11:55:46 -07:00
commit 6d3a508dbf
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