Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

hassbian-config: Added checks for RPiZero on suites that won't run. #153

Merged
merged 1 commit into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/cloud9.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Description
Cloud9 SDK is an webservice IDE that makes it easy to manage your configuration files.

*This suite can't be installed on Raspberry Pi Zero*

## Installation
```bash
$ sudo hassbian-config install cloud9
Expand Down
4 changes: 3 additions & 1 deletion docs/homebridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ This will allow you to control your home with Apple's HomeKit (Siri on iOS, OSX
By default all devices are hidden, and you will need to add som entries in your `customize.yaml` configuration.
You can learn more about this in the [Home Assistant for Homebridge repo.](https://github.com/home-assistant/homebridge-homeassistant#customization)

_NB!: This install script will fail resulting in your Pi to reboot, if you do not use an recommended level power supply._
_NB!: This install script will fail resulting in your Pi to reboot, if you do not use an recommended level power supply._

*This suite can't be installed on Raspberry Pi Zero*

## Installation
```
Expand Down
2 changes: 2 additions & 0 deletions docs/mosquitto.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Description
This script installs the MQTT Mosquitto server. Repository from the Mosquitto project is added to package system and the official packages for Debian are installed. Additionally, this script helps you create your first MQTT user that can be used with Home Assistant.

*This suite can't be installed on Raspberry Pi Zero*

## Installation
```
$ sudo hassbian-config install mosquitto
Expand Down
15 changes: 15 additions & 0 deletions package/usr/local/bin/hassbian-config
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ function check-permission {
return 0
}

function raspberry_pi_zero_check {
## Start check for Raspberry Pi Zero
if [ "$FORCE" != "true" ]; then
REVCODE=$(sudo cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^ *//g' | sed 's/ *$//g')
if [ "$REVCODE" = "90092" ] || [ "$REVCODE" = "90093" ] || [ "$REVCODE" = "0x9000C1" ]; then
if [[ "$1" =~ ^(mosquitto|homebridge|cloud9)$ ]]; then
echo "This suite can't be installed on Raspberry Pi Zero..."
exit 0
fi
fi
fi
## End check for Raspberry Pi Zero

}
function share-log {
if [ ! -f $LOGFILE ];then
echo "No logfile, exiting..."
Expand Down Expand Up @@ -149,6 +163,7 @@ function run-suite { #This is the function the actually run install/upgrade.

function install-suite { #This function do checks if we can/want to install.
check-permission
raspberry_pi_zero_check "$1"
INSTALL=$(grep "$1"-install-package "$SUITE_INSTALL_DIR/$1".sh) #Checking if suite has install function.
SUITESTATE=$(if [ -f "$SUITE_CONTROL_DIR/$1" ]; then grep "SCRIPTSTATE" "$SUITE_CONTROL_DIR/$1" | awk -F'=' '{print $2}'; else echo ""; fi) #Checking current suite state.
if [ "$FORCE" == "true" ]; then #Go straight to run-suite if --force is used.
Expand Down