Skip to content

Instantly share code, notes, and snippets.

@aziascreations
Created February 15, 2017 21:16
Show Gist options
  • Save aziascreations/bbbd56433e5f6d68d049f55b662165a0 to your computer and use it in GitHub Desktop.
Save aziascreations/bbbd56433e5f6d68d049f55b662165a0 to your computer and use it in GitHub Desktop.
RaspberryPi Node.js installer
#!/bin/bash
# UNFINISHED AND UNTESTED
# DO NOT USE
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
echo "Testing internet connection..."
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Internet connection is up !"
else
echo "Internet connection seems to be down !"
exit 1
fi
echo "Downloading Node.js..."
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
echo "Installing Node.js..."
apt install nodejs
echo "Node.js version :"
node -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment