From 2bd06b2b4c2adbb8d8fe94e6c99762ac672e7774 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 19 Jan 2016 11:50:07 +0100 Subject: [PATCH] Use id -u instead of whoami Multiple users can have root credentials on FreeBSD by default root and toor has it. Instead of checking the name of the super user, check that its id is 0 --- launchctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchctl b/launchctl index dee7954..f1f5979 100755 --- a/launchctl +++ b/launchctl @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -if [ `whoami` = 'root' ] ; then +if [ `id -u` -eq 0 ] ; then if [ -d /var/db ] ; then pkgdatadir="/var/db/launchd" else -- 2.7.0