Skip to content

Commit 15983c2

Browse files
authored
Merge pull request #47 from railsgirls/ubuntu_script_not_for_root
Do not allow running ubuntu script as root
2 parents b10be4f + cd9737b commit 15983c2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rails-install-ubuntu.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22

3+
if
4+
[[ "${USER:-}" == "root" ]]
5+
then
6+
echo "This script works only with normal user, it wont work with root, please log in as normal user and try again." >&2
7+
exit 1
8+
fi
9+
310
set -e
411

512
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

0 commit comments

Comments
 (0)