forked from lamassu/lamassu-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·42 lines (37 loc) · 1.45 KB
/
setup.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
mkdir -p data/log
mkdir -p ui/css/fonts
mkdir -p /tmp/lamassu-fonts
rm /tmp/lamassu-fonts/* -rf
echo
if [ ! -d "node_modules" ]; then
echo "node.js dependencies not yet installed.. installing them now."
npm install
if [ ! -h "jasmine" ]; then
ln -s ./node_modules/jasmine/bin/jasmine.js jasmine
fi
if [ ! -h "istanbul" ]; then
ln -s ./node_modules/istanbul/lib/cli.js istanbul
fi
else
echo "node_modules folder found. skipping dependency install."
fi
echo "Downloading fonts..."
curl -# -L https://github.com/adobe-fonts/source-sans-pro/archive/2.010R-ro/1.065R-it.zip > /tmp/lamassu-fonts/source-sans-pro.zip
curl -# -L https://github.com/adobe-fonts/source-code-pro/archive/1.017R.zip > /tmp/lamassu-fonts/source-code-pro.zip
echo "Installing fonts in lamassu-machine..."
unzip -q /tmp/lamassu-fonts/source-sans-pro.zip -d /tmp/lamassu-fonts
unzip -q /tmp/lamassu-fonts/source-code-pro.zip -d /tmp/lamassu-fonts
cp -rf /tmp/lamassu-fonts/source-sans-pro-*/TTF ui/css/fonts
cp -rf /tmp/lamassu-fonts/source-code-pro-*/TTF ui/css/fonts
echo "Setting up config files..."
cp device_config.sample.json device_config.json
echo "Setting up keys..."
cp data/client.sample.key data/client.key
cp data/client.sample.pem data/client.pem
if [ ! -e "licenses.json" ]; then
echo
echo "licenses.json not found. Edit the licenses.sample.json file, and add your API keys manually."
echo
fi
echo "Successful installation."