summaryrefslogtreecommitdiff
path: root/bin/deb-src/DEBIAN/preinst
blob: e5b5e0b747225affa845342ff52e38fa86479532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

# Installs node if it isn't already installed
#
# Don't steamroll over a previously installed node version
# TODO provide a local version of node?

VER="0.10.4"
ARCH="x86"
if [ `arch | grep 64` ]
then
  ARCH="x64"
fi

# TODO test version
if [ ! -f /usr/local/bin/node ]
then
  pushd /tmp
  wget -c "http://nodejs.org/dist/v${VER}/node-v${VER}-linux-${ARCH}.tar.gz"
  rm -rf /tmp/node-v${VER}-linux-${ARCH}
  tar xf node-v${VER}-linux-${ARCH}.tar.gz -C /tmp/
  cp -a /tmp/node-v${VER}-linux-${ARCH}/* /usr/local/
fi

# Create Etherpad user
adduser --system etherpad