Commit 8eef57d0 authored by Michał Siwek's avatar Michał Siwek

Merge pull request #166 from lyxell/disallow-sudo

Disallow sudo
parents 3cdbf3ba db07c76a
......@@ -21,6 +21,9 @@ $LOAD_PATH.unshift "#{CREW_LIB_PATH}lib"
USER = `whoami`.chomp
#disallow sudo
abort "Chromebrew should not be run as root." if Process.uid == 0 && @command != "remove"
@device = JSON.parse(File.read(CREW_CONFIG_PATH + 'device.json'), symbolize_names: true)
#symbolize also values
@device.each do |key, elem|
......
......@@ -13,6 +13,11 @@ CREW_PACKAGES_PATH=$CREW_LIB_PATH/packages
user=$(whoami)
architecture=$(uname -m)
if [ $EUID -eq 0 ]; then
echo 'Chromebrew should not be run as root.'
exit 1;
fi
if [ $architecture != "i686" ] && [ $architecture != "x86_64" ]; then
echo 'Your device is not supported by Chromebrew yet.'
exit 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment