r7506: handle the case where cron does not setup $USER
authorAndrew Tridgell <tridge@samba.org>
Sun, 12 Jun 2005 07:48:53 +0000 (07:48 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:01 +0000 (13:18 -0500)
(This used to be commit d4c1a1be0acbb11df4cfef5e454787b3f86f4181)

source4/script/tests/selftest.sh

index 880a2f097bc4bad8cfb27d9d0d9518d2e1078009..c4f8a5a5a95728b5fe3290f51d6e085b689fce8d 100755 (executable)
@@ -3,8 +3,11 @@ DOMAIN=SAMBADOMAIN
 USERNAME=administrator
 REALM=$DOMAIN
 PASSWORD=penguin
-ROOT=$USER
 SRCDIR=`pwd`
+ROOT=$USER
+if test -z "$ROOT"; then
+    ROOT=`whoami`
+fi
 
 if [ $# -lt 1 ]
 then