From patchwork Wed Aug 29 15:07:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] fwts-collect: make sure we are executing as root or with sudo Date: Wed, 29 Aug 2012 05:07:08 -0000 From: Chris Van Hoof X-Patchwork-Id: 180714 Message-Id: <1346252828-16590-1-git-send-email-vanhoof@canonical.com> To: fwts-devel@lists.ubuntu.com Signed-off-by: Chris Van Hoof Acked-by: Colin Ian King Acked-by: Alex Hung --- scripts/fwts-collect | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/fwts-collect b/scripts/fwts-collect index d6e748f..0b5838a 100755 --- a/scripts/fwts-collect +++ b/scripts/fwts-collect @@ -22,6 +22,14 @@ TMPDIR=/tmp/fwts.$$ FWTS=`which fwts` # +# Check if executed as root or with sudo +# +if [ $EUID -ne 0 ]; then + echo "`basename $0`: must be executed with sudo" + exit 1 +fi + +# # sighandler # on_die()