Skip to content

Commit cd9737b

Browse files
committed
Do not allow running ubuntu script as root
1 parent b10be4f commit cd9737b

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)