Skip to content

Instantly share code, notes, and snippets.

@ghoulmann
Created November 1, 2012 21:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghoulmann/3996756 to your computer and use it in GitHub Desktop.
Save ghoulmann/3996756 to your computer and use it in GitHub Desktop.
Haste-Server Install Script for Raspian
#!/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
@cgelici
Copy link

cgelici commented Oct 30, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment