Skip to content

Instantly share code, notes, and snippets.

@dale3h
Last active June 12, 2019 18:52
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dale3h/340c49ab8295876db2db73c40f99ae93 to your computer and use it in GitHub Desktop.
Save dale3h/340c49ab8295876db2db73c40f99ae93 to your computer and use it in GitHub Desktop.
Hass.io Installer for Raspberry Pi 3 B+
#!/bin/bash
###########################################################
###########################################################
## ##
## THIS SCRIPT SHOULD ONLY BE RUN ON A RASPBERRY PI 3 B+ ##
## ##
###########################################################
###########################################################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
echo "Please try again with:"
echo " sudo $0"
exit 1
fi
requirements=("socat" "jq" "curl" "avahi-daemon" "dbus-daemon")
missing=
for cmd in ${requirements[@]}; do
package="$cmd"
[[ "$cmd" == "dbus-daemon" ]] && package="dbus"
[[ $(command -v "$cmd") ]] || missing="$missing$package "
done
if [[ -n "$missing" ]]; then
echo "Attempting install of: $missing"
apt-get update
apt-get install -y $missing
fi
if [[ ! $(command -v docker) ]]; then
curl -sSL https://get.docker.com | sh
fi
requirements=("docker" "bash" "socat" "jq" "curl" "avahi-daemon" "dbus-daemon")
missing=
echo "Checking for all requirements..."
for cmd in ${requirements[@]}; do
package="$cmd"
[[ "$cmd" == "dbus-daemon" ]] && package="dbus"
[[ $(command -v "$cmd") ]] || missing="$missing$package "
done
if [[ -n "$missing" ]]; then
echo "Could not install requirements: $missing"
echo "Please install manually and run this script again."
exit 1
else
echo "All requirements found!"
fi
echo "Installing Hass.io..."
curl -sL https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install | bash -s -- -m raspberrypi3
echo
echo "Done."
@justinw78
Copy link

Thnx for the script. It worked super. But i have a little question. What user is running hassio once the script is installed?

greetings justin

@swefse
Copy link

swefse commented Jul 5, 2018

Hey!

Tried the script and it installed fine, but the issue I get is that, after preparing the HASSio installation for 25 mins, it times out whenever I go to the IP address:8123. The Pi is on WiFi, and I have no access to an Ethernet plug. What can I try to fix that?

@lauborges
Copy link

Thnx for the script. It worked super. But i have a little question. What user is running hassio once the script is installed?

greetings justin

systemctl start hassio-supervisor.service

@phamre
Copy link

phamre commented May 5, 2019

can anyone help me?

getting this

Installing Hass.io...
bash: line 1: 404:: command not found

Done.

@LeshM
Copy link

LeshM commented Jun 12, 2019

can anyone help me?

getting this

Installing Hass.io...
bash: line 1: 404:: command not found

Done.

the install script is deprecated.
needs to be replaced with this:

curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s -- -m raspberrypi3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment