Created
December 30, 2015 15:25
-
-
Save stripedpurple/8dbd0fa877d23d9bc695 to your computer and use it in GitHub Desktop.
Installs MQTT broker (Mosquitto) on raspberry pi
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/sh | |
# Check to see if the script was run as Root | |
if [[ "$EUID" -ne 0 ]]; then | |
echo "Sorry, you need to run this as root" | |
exit 1 | |
fi | |
cd /etc/apt/sources.list.d/ | |
debVer=`lsb_release -a | grep -i codename | awk '{print $2}'` | |
if [ '$debVer' == 'jessie' ]; then | |
wget http://repo.mosquitto.org/debian/mosquitto-jessie.list | |
else if [ '$debVer' == 'wheezy' ]; then | |
wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list | |
else | |
echo 'Sorry, but this script does not support your version of Raspbian! :(' | |
exit 1 | |
fi | |
apt-get update -y | |
apt-get install mosquitto -y | |
echo 'Enjoy!!!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment