This repository has been archived by the owner on Oct 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds pihole install script * Adds pihole install script
- Loading branch information
Showing
3 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |