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

hassbian-config: New run-suite function #138

Merged
merged 5 commits into from
Mar 13, 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
11 changes: 0 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand All @@ -119,8 +117,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand All @@ -142,8 +138,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand All @@ -163,17 +157,12 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
return 0
```

This line should only be printed it the validation fails.
`"If you have issues with this script, please say something in the #devs_hassbian channel on Discord."`

## Testing your code
Testing the code can be done in the folowing steps:
1. Make sure you have the newest version from the upstream dev. branch. `sudo hassbian-config upgrade hassbian-script-dev`
Expand Down
4 changes: 2 additions & 2 deletions docs/hassbian_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ where command is one of:
- `share-log` This will generate an hastebin link of the last hassbian-config operation.

Optional flags:
- `-y | --accept` This will accept defaults on scripts that allow this.
- `-f | --force` This will force run an script. This is useful if you need to reinstall a package.
- `-Y | --accept` This will accept defaults on scripts that allow this.
- `-F | --force` This will force run an script. This is useful if you need to reinstall a package.
- `-D | --debug` This will output every comand to the console.

Other available commands:
Expand Down
10 changes: 0 additions & 10 deletions package/opt/hassbian/suites/appdaemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function appdaemon-show-copyright-info {
}

function appdaemon-install-package {
appdaemon-show-short-info
appdaemon-show-copyright-info

if [ "$ACCEPT" != "true" ]; then
if [ -f "/usr/sbin/samba" ]; then
echo -n "Do you want to add Samba share for AppDaemon configuration? [N/y] : "
Expand Down Expand Up @@ -89,18 +86,13 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
return 0
}

function appdaemon-upgrade-package {
appdaemon-show-short-info
appdaemon-show-copyright-info

echo "Stopping AppDaemon service..."
systemctl stop appdaemon@homeassistant.service

Expand Down Expand Up @@ -133,8 +125,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mUpgrade failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
6 changes: 0 additions & 6 deletions package/opt/hassbian/suites/duckdns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ function duckdns-show-copyright-info {
}

function duckdns-install-package {
duckdns-show-long-info
duckdns-show-copyright-info

echo
echo "Please take a moment to setup autorenewal of duckdns."
echo "If no choice is made the installation will exit."
echo
Expand Down Expand Up @@ -108,8 +104,6 @@ if [ ! -z "${certvalidation}" ] && [ ! -z "${dnsvalidation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
3 changes: 0 additions & 3 deletions package/opt/hassbian/suites/hassbian-script-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function hassbian-script-dev-show-copyright-info {
}

function hassbian-script-dev-upgrade-package {
hassbian-script-dev-show-short-info
hassbian-script-dev-show-copyright-info

echo "Creation and changing in to temporary folder."
cd || exit
sudo mkdir /tmp/hassbian_config_update
Expand Down
3 changes: 0 additions & 3 deletions package/opt/hassbian/suites/hassbian-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function hassbian-script-show-copyright-info {
}

function hassbian-script-upgrade-package {
hassbian-script-show-short-info
hassbian-script-show-copyright-info

echo "Changing to temporary folder"
cd /tmp || exit

Expand Down
3 changes: 0 additions & 3 deletions package/opt/hassbian/suites/hassbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function hassbian-show-copyright-info {
}

function hassbian-upgrade-package {
hassbian-show-short-info
hassbian-show-copyright-info

echo "Updating package list"
sudo apt update

Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/homeassistant-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function homeassistant-dev-show-copyright-info {
}

function homeassistant-dev-install-package {
homeassistant-dev-show-short-info
homeassistant-dev-show-copyright-info

echo "Stopping Home Assistant"
systemctl stop home-assistant@homeassistant.service
sync
Expand Down Expand Up @@ -54,8 +51,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
10 changes: 0 additions & 10 deletions package/opt/hassbian/suites/homeassistant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function homeassistant-show-copyright-info {
}

function homeassistant-install-package {
homeassistant-show-short-info
homeassistant-show-copyright-info

echo "Changing to the homeassistant user"
sudo -u homeassistant -H /bin/bash << EOF

Expand Down Expand Up @@ -57,18 +54,13 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
return 0
}

function homeassistant-upgrade-package {
homeassistant-show-short-info
homeassistant-show-copyright-info

echo "Checking current version"
pypiversion=$(curl -s https://pypi.python.org/pypi/homeassistant/json | grep '"version":' | awk -F'"' '{print $4}')

Expand Down Expand Up @@ -112,8 +104,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mUpgrade failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/homebridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function homebridge-show-copyright-info {
}

function homebridge-install-package {
homebridge-show-long-info
homebridge-show-copyright-info

if [ "$ACCEPT" == "true" ]; then
HOMEASSISTANT_URL="http://127.0.0.1:8123"
HOMEASSISTANT_PASSWORD=""
Expand Down Expand Up @@ -141,8 +138,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/hue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function hue-show-copyright-info {
}

function hue-install-package {
hue-show-short-info
hue-show-copyright-info

echo "Setting permissions for Python."
PYTHONVER=$(echo /usr/lib/*python* | awk -F/ '{print $NF}')
sudo setcap 'cap_net_bind_service=+ep' /usr/bin/"$PYTHONVER"
Expand All @@ -32,8 +29,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/libcec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function libcec-show-copyright-info {
}

function libcec-install-package {
libcec-show-short-info
libcec-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y cmake libudev-dev libxrandr-dev swig
Expand Down Expand Up @@ -82,8 +79,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function mariadb-show-copyright-info {
}

function mariadb-install-package {
mariadb-show-short-info
mariadb-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y mariadb-server libmariadbclient-dev
Expand Down Expand Up @@ -47,8 +44,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/mosquitto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function mosquitto-show-copyright-info {
}

function mosquitto-install-package {
mosquitto-show-short-info
mosquitto-show-copyright-info

if [ "$ACCEPT" == "true" ]; then
mqtt_username=pi
mqtt_password=raspberry
Expand Down Expand Up @@ -102,8 +99,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/mssql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function mssql-show-copyright-info {
}

function mssql-install-package {
mssql-show-short-info
mssql-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y freetds-dev
Expand Down Expand Up @@ -52,8 +49,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function mysql-show-copyright-info {
}

function mysql-install-package {
mysql-show-short-info
mysql-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y default-libmysqlclient-dev libssl-dev
Expand Down Expand Up @@ -50,8 +47,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/postgresql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ function postgresql-show-copyright-info {
}

function postgresql-install-package {
postgresql-show-short-info
postgresql-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y postgresql-server-dev-9.6 postgresql-9.6
Expand Down Expand Up @@ -47,8 +44,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
4 changes: 0 additions & 4 deletions package/opt/hassbian/suites/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function python-show-copyright-info {
}

function python-upgrade-package {
python-show-short-info
python-show-copyright-info

if [ "$FORCE" == "" ]; then
printf "\\n\\n"
echo "This script will change a lot on your pi."
Expand Down Expand Up @@ -112,7 +109,6 @@ else
rm -R /srv/homeassistant
mv /srv/homeassistant_"$currentpython" /srv/homeassistant
systemctl start home-assistant@homeassistant.service
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
3 changes: 0 additions & 3 deletions package/opt/hassbian/suites/razberry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ function razberry-show-copyright-info {
}

function razberry-install-package {
razberry-show-short-info
razberry-show-copyright-info

echo "Checking for version of Raspberry Pi"
RPI_BOARD_REVISION=$(grep Revision /proc/cpuinfo | cut -d: -f2 | tr -d " ")
if [[ $RPI_BOARD_REVISION == "a02082" || $RPI_BOARD_REVISION == "a22082" ]]
Expand Down
5 changes: 0 additions & 5 deletions package/opt/hassbian/suites/samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function samba-show-copyright-info {
}

function samba-install-package {
samba-show-short-info
samba-show-copyright-info

echo "Running apt-get preparation"
apt-get update
apt-get install -y samba
Expand Down Expand Up @@ -60,8 +57,6 @@ if [ ! -z "${validation}" ]; then
else
echo
echo -e "\\e[31mInstallation failed..."
echo -e "\\e[31mAborting..."
echo -e "\\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord."
echo
return 1
fi
Expand Down
Loading