Merge pull request #165 from izmailoff/patch-1

Fix fork bomb if user is not root, don't try to sudo exec it, just fail.
This commit is contained in:
Calin Crisan 2016-02-14 11:02:48 +02:00
commit 4bfe33f955

View File

@ -16,7 +16,7 @@ if [ -z "$1" ]; then
usage
fi
test "root" != "$USER" && exec sudo $0 "$@"
if [[ $(id -u) -ne 0 ]]; then echo "Please run as root"; exit 1; fi
function msg() {
echo ":: $1"