Created
November 1, 2012 21:37
-
-
Save ghoulmann/3996756 to your computer and use it in GitHub Desktop.
Haste-Server Install Script for Raspian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
#Check for root | |
LUID=$(id -u) | |
if [[ $LUID -ne 0 ]]; then | |
echo "$0 must be run as root" | |
exit 1 | |
fi | |
#Prolly don't change this | |
name=haste-server | |
#set your install directory here | |
target=/opt/$name | |
apt-get update | |
apt-get install git nodejs npm redis-server -y | |
git clone git://github.com/seejohnrun/haste-server.git $target | |
sed -i "s|7777|8080|" $target/config.js | |
cd $target | |
npm install | |
cd ~/ | |
adduser --system --no-create-home $name | |
addgroup $name | |
usermod -G $name $name | |
chown -R $name:$name $target | |
sed -i 's|exit 0|"npm start $target" &|' >> /etc/rc.local | |
echo "exit 0" >> /etc/rc.local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need to add the 'nodejs-legacy' package to the apt-get install line. Otherwise npm start will call 'node' which isn't available unless you have the legacy installed