make sure 'build' user has proper sudoers setup
authorMarc Fiuczynski <mef@cs.princeton.edu>
Mon, 10 Sep 2007 19:39:10 +0000 (19:39 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Mon, 10 Sep 2007 19:39:10 +0000 (19:39 +0000)
make.sh

diff --git a/make.sh b/make.sh
index d207364..32647a4 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -17,7 +17,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2007 The Trustees of Princeton University
 #
-# $Id$
+# $Id: make.sh,v 1.2 2007/02/07 23:49:42 mlhuang Exp $
 #
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
@@ -46,6 +46,11 @@ trap "cleanup" ERR INT
 # Start development environment
 sudo $BASE/BUILD/myplc-devel-*/myplc/host.init start
 
+# Make sure "build" user has proper sudoers setup
+if [ $(sudo grep "build.*ALL=(ALL).*NOPASSWD:.*ALL" $PLC_ROOT/etc/sudoers | wc -l) -eq 0 ] ; then
+       sudo echo "build ALL=(ALL) NOPASSWD: ALL" >> $PLC_ROOT/etc/sudoers
+fi
+
 # Cross mount the current build directory to the build user home directory
 sudo mount -o bind,rw $BASE $PLC_ROOT/data/build