Require root to run install.sh
This commit is contained in:
@@ -18,12 +18,13 @@ function isDebug() {
|
||||
}
|
||||
|
||||
function main() {
|
||||
id -Gn | grep admin >&! /dev/null || { echo 'This script requires root access. Please run as an admin user.' >&2; return 10 }
|
||||
local tmpdir="`mktemp -d -t 'macos-system'`"
|
||||
isDebug || trap "rm -fr -- '${tmpdir}'; return" INT TERM EXIT
|
||||
pushd -q "${tmpdir}"
|
||||
cloneMacOSSystemRepo
|
||||
cloneZSHLibRepo
|
||||
./install.sh
|
||||
sudo ./install.sh
|
||||
popd -q
|
||||
}
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ function isPlistBuddyInstalled() {
|
||||
function checkPrerequisites() {
|
||||
isMacOS || { lop error 'This setup is only for macOS 10.13 and up.'; return 10 }
|
||||
isPlistBuddyInstalled || { lop error 'This setup requires PlistBuddy to be either at /usr/libexec or in any of the PATH directories.'; return 11 }
|
||||
test "`id -u`" -eq 0 || { lop error 'This module requires root access. Please run as root.'; return 11 }
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
Reference in New Issue
Block a user