2016-04-05 15:43:52 -04:00
|
|
|
#!/usr/bin/env bash
|
2016-04-04 12:19:13 -04:00
|
|
|
# $$\ $$\ $$\ $$\ $$\ $$\ $$$$$$\
|
|
|
|
# $$$\ $$$ | \__| $$$\ $$$ |\__| $$ __$$\
|
|
|
|
# $$$$\ $$$$ | $$$$$$\ $$$$$$\ $$\ $$$$$$$\ $$$$\ $$$$ |$$\ $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\ \__/ $$ |
|
|
|
|
# $$\$$\$$ $$ | \____$$\ $$ __$$\ $$ |$$ _____|$$\$$\$$ $$ |$$ |$$ __$$\ $$ __$$\ $$ __$$\ $$ __$$\ $$$$$$ |
|
|
|
|
# $$ \$$$ $$ | $$$$$$$ |$$ / $$ |$$ |$$ / $$ \$$$ $$ |$$ |$$ | \__|$$ | \__|$$ / $$ |$$ | \__|$$ ____/
|
|
|
|
# $$ |\$ /$$ |$$ __$$ |$$ | $$ |$$ |$$ | $$ |\$ /$$ |$$ |$$ | $$ | $$ | $$ |$$ | $$ |
|
|
|
|
# $$ | \_/ $$ |\$$$$$$$ |\$$$$$$$ |$$ |\$$$$$$$\ $$ | \_/ $$ |$$ |$$ | $$ | \$$$$$$ |$$ | $$$$$$$$\
|
|
|
|
# \__| \__| \_______| \____$$ |\__| \_______|\__| \__|\__|\__| \__| \______/ \__| \________|
|
|
|
|
# $$\ $$ |
|
|
|
|
# \$$$$$$ |
|
|
|
|
# \______/
|
|
|
|
#
|
|
|
|
# This is an installer script for MagicMirror2. It works well enough
|
|
|
|
# that it can detect if you have Node installed, run a binary script
|
|
|
|
# and then download and run MagicMirror2.
|
2016-04-09 15:10:47 +02:00
|
|
|
|
|
|
|
echo "Installing helper tools ..."
|
2016-04-05 15:52:10 -04:00
|
|
|
sudo apt-get install curl wget build-essential unzip || exit
|
2016-04-04 12:19:13 -04:00
|
|
|
ARM=$(uname -m) # Determine which Pi is running.
|
2016-05-06 16:57:14 +02:00
|
|
|
|
|
|
|
#NODE_LATEST=$(curl -l http://api.jordidepoortere.com/nodejs-latest/) # Fetch the latest version of Node.js.
|
|
|
|
#DOWNLOAD_URL="https://nodejs.org/dist/latest/node-$NODE_LATEST-linux-$ARM.tar.gz" # Construct the download URL.
|
|
|
|
|
|
|
|
#Node 6 should not be used at the moment...
|
|
|
|
NODE_LATEST="v5.9.1" # Fetch the latest version of Node.js.
|
|
|
|
DOWNLOAD_URL="https://nodejs.org/dist/v5.9.1/node-$NODE_LATEST-linux-$ARM.tar.gz" # Construct the download URL.
|
2016-04-09 15:10:47 +02:00
|
|
|
|
|
|
|
echo "Installing Latest Node.js ..."
|
|
|
|
mkdir ~/.MagicMirrorInstaller || exit
|
|
|
|
cd ~/.MagicMirrorInstaller || exit
|
2016-04-05 15:52:10 -04:00
|
|
|
wget $DOWNLOAD_URL || exit # Download the file given.
|
|
|
|
tar xvf node-$NODE_LATEST-linux-$ARM.tar.gz || exit
|
|
|
|
cd node* || exit
|
|
|
|
sudo cp -R * /usr/local || exit
|
2016-04-09 15:10:47 +02:00
|
|
|
cd ~ || exit
|
|
|
|
rm -Rf ~/.MagicMirrorInstaller || exit
|
|
|
|
|
|
|
|
echo "Cloning MagicMirror ..."
|
|
|
|
git clone -b v2-beta https://github.com/MichMich/MagicMirror.git || exit
|
2016-04-09 15:34:18 +02:00
|
|
|
cd ~/MagicMirror || exit
|
2016-04-05 15:52:10 -04:00
|
|
|
npm install || exit
|
2016-04-13 15:00:05 +02:00
|
|
|
echo "We're ready! Run [DISPLAY=:0 npm start] from the MagicMirror directory."
|