Skip to content

Commit e6de184

Browse files
committedDec 21, 2015
install-reddit: Add some sanity checks
This should help make explicit some of the assumptions in the install script and reduce confusion among people trying to get reddit running.
1 parent db4cd43 commit e6de184

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
 

‎install-reddit.sh

+25
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@ if [[ $EUID -ne 0 ]]; then
7272
exit 1
7373
fi
7474

75+
if [[ -z "$REDDIT_USER" ]]; then
76+
# in a production install, you'd want the code to be owned by root and run
77+
# by a less privileged user. this script is intended to build a development
78+
# install, so we expect the owner to run the app and not be root.
79+
cat <<END
80+
ERROR: You have not specified a user. This usually means you're running this
81+
script directly as root. It is not recommended to run reddit as the root user.
82+
83+
Please create a user to run reddit and set the REDDIT_USER variable
84+
appropriately.
85+
END
86+
exit 1
87+
fi
88+
89+
if [[ "amd64" != $(dpkg --print-architecture) ]]; then
90+
cat <<END
91+
ERROR: This host is running the $(dpkg --print-architecture) architecture!
92+
93+
Because of the pre-built dependencies in our PPA, and some extra picky things
94+
like ID generation in liveupdate, installing reddit is only supported on amd64
95+
architectures.
96+
END
97+
exit 1
98+
fi
99+
75100
# seriously! these checks are here for a reason. the packages from the
76101
# reddit ppa aren't built for anything but trusty (14.04) right now, so
77102
# if you try and use this install script on another release you're gonna

0 commit comments

Comments
 (0)