Created
February 15, 2017 21:16
-
-
Save aziascreations/bbbd56433e5f6d68d049f55b662165a0 to your computer and use it in GitHub Desktop.
RaspberryPi Node.js installer
This file contains 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/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