diff --git a/install_mosquitto.sh b/install_mosquitto.sh index f86a02de..a11e89ec 100755 --- a/install_mosquitto.sh +++ b/install_mosquitto.sh @@ -6,6 +6,11 @@ echo "Modified by Landrash for use with Hassbian." echo "Copyright(c) 2016 Dale Higgs " echo +if [ "$(id -u)" != "0" ]; then +echo "This script must be run with sudo. Use \"sudo ${0} ${*}\"" 1>&2 +exit 1 +fi + echo "Adding mosquitto user" adduser mosquitto --system --group diff --git a/install_openzwave.sh b/install_openzwave.sh index aa6208a2..da9daaf5 100755 --- a/install_openzwave.sh +++ b/install_openzwave.sh @@ -1,12 +1,16 @@ #!/bin/bash - echo echo "Open Z-Wave Installer for Hassbian" echo "Modified by Landrash for use with Hassbian." echo "Copyright(c) 2016 Dale Higgs " echo +if [ "$(id -u)" != "0" ]; then +echo "This script must be run with sudo. Use \"sudo ${0} ${*}\"" 1>&2 +exit 1 +fi + echo "Running apt-get preparation" apt-get update apt-get upgrade -y