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

Commit

Permalink
Pihole (#204)
Browse files Browse the repository at this point in the history
* Adds pihole install script

* Adds pihole install script
  • Loading branch information
Landrash authored and ludeeus committed Oct 23, 2018
1 parent 5df3a79 commit 6776a78
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Hassbian-scripts

These are the scripts used in the [Hassbian][hassbian] image.
These are the scripts used in the [Hassbian][hassbian] image.
The scripts in this repository where made to be used with the Hassbian image
and the included Home Assistant instance.
and the included Home Assistant instance.

## The included scripts

Expand All @@ -23,6 +23,7 @@ below for usage and instructions.
- [MariaDB](/docs/mariadb.md)
- [Monitor](/docs/monitor.md)
- [Mosquitto](/docs/mosquitto.md)
- [Pi-hole](/docs/pihole.md)
- [PostgreSQL](/docs/postgresql.md)
- [MS SQL](/docs/mssql.md)
- [RaZberry](/docs/razberry.md)
Expand Down
30 changes: 30 additions & 0 deletions docs/pihole.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Monitor

This script downloads and runs the [Pi-Hole][pihole] install script from https://pi-hole.net/ .
## Installation

```bash
sudo hassbian-config install pihole
```

## Upgrade

Upgrades are handled by the Pi-hole software

## Additional info

Description | Command/value
:--- | :---
Running as: | pihole
Start service: | `sudo systemctl start pihole-FTL.service `
Stop service: | `sudo systemctl stop pihole-FTL.service`
Restart service: | `sudo systemctl restart pihole-FTL.service`
Service status: | `sudo systemctl status pihole-FTL.service`

***

This install script was originally contributed by [@Landrash][landrash]

<!--- Links --->
[landrash]: https://github.com/landrash
[pihole]: https://pi-hole.net/
46 changes: 46 additions & 0 deletions package/opt/hassbian/suites/pihole.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
function pihole-show-short-info {
echo "Downloads and runs the Pi-hole install script."
}

function pihole-show-long-info {
echo "This script downloads and runs the Pi-hole install script"
echo "All credit for the install script goes to the Pi-hole authors."
}

function pihole-show-copyright-info {
echo "Original concept by Landrash <https://github.com/landrash>."
}

function pihole-install-package {
echo -n "Downloading Pi-hole install script: "
mkdir /tmp/pihole || exit
cd /tmp/pihole || exit
wget -O basic-install.sh https://install.pi-hole.net

echo "Running interactive setup"
cd /tmp/pihole || exit
chmod +x /tmp/pihole/basic-install.sh || exit
bash /tmp/pihole/basic-install.sh

echo "Checking the installation..."
ip_address=$(ifconfig | grep "inet.*broadcast" | grep -v 0.0.0.0 | awk '{print $2}')

echo "Checking the installation..."
validation=$(pgrep -f pihole)
if [ ! -z "${validation}" ]; then
echo
echo -e "\\e[32mInstallation done.\\e[0m"
echo
echo "Your Pi-Hole instance is running at $ip_address or if preferred hassbian.local"
echo
else
echo
echo -e "\\e[31mInstallation failed..."
echo
return 1
fi
return 0
}

[[ "$_" == "$0" ]] && echo "hassbian-config helper script; do not run directly, use hassbian-config instead"

0 comments on commit 6776a78

Please sign in to comment.