Last active
December 18, 2015 17:51
-
-
Save ryansturmer/e5fe3bd2e7dcf1f91152 to your computer and use it in GitHub Desktop.
Clean install of the FabMo Engine for the Intel Edison
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/sh -vex | |
# To run as one-liner: | |
# wget https://goo.gl/JfLl3S -v -O fabmo_install.sh && chmod u+x ./fabmo_install.sh && ./fabmo_install.sh | |
# Stop running instances of the engine and updater | |
systemctl stop fabmo | |
systemctl stop fabmo-updater | |
# Clear out old installations | |
rm -rf /fabmo /opt/fabmo | |
mkdir -p /opt/fabmo/config | |
echo '{"wifi_manager" : true}' > /opt/fabmo/config/engine.json | |
# Install the updater | |
mkdir -p /fabmo/updater | |
git clone https://github.com/FabMo/FabMo-Updater.git /fabmo/updater | |
cd /fabmo/updater | |
npm install --production | |
# Install the engine | |
mkdir -p /fabmo/engine | |
git clone https://github.com/FabMo/FabMo-Engine.git /fabmo/engine | |
cd /fabmo/engine | |
npm install --production | |
# Install engine and updater systemd services | |
cp /fabmo/engine/files/fabmo.service /etc/systemd/system | |
cp /fabmo/updater/files/fabmo-updater.service /etc/systemd/system | |
# Done with a huge install, do a sync, superstitiously | |
sync | |
systemctl daemon-reload | |
systemctl disable fabmo | |
systemctl enable fabmo | |
systemctl disable fabmo-updater | |
systemctl enable fabmo-updater | |
systemctl restart fabmo | |
systemctl restart fabmo-updater | |
# Wait for the engine to start, and then do a sync for real before shutting down | |
sleep 15 | |
sync | |
echo "FabMo was installed successfully." | |
echo "Please power cycle your tool." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment