From 03611dc63e3e44d0504f0d05c3129fbc0b2d1510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Wed, 8 Jan 2014 01:15:37 +0100 Subject: Switch to root when started as regular user In collaborative builder machine, these scripts are often allowed to become root via sudo. This patch avoid to prefix them by sudo each time or call su. Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 47c6ac9..97c7780 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -81,7 +81,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do esac done -(( EUID != 0 )) && die 'This script must be run as root.' +check_root "$0" "$@" [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a directory containing a PKGBUILD.' -- cgit v1.2.3