-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PADD installer and patch to the package
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 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,58 @@ | ||
diff --git a/padd.sh b/padd.sh | ||
index 8fa5ef86..e86332e9 100755 | ||
--- a/padd.sh | ||
+++ b/padd.sh | ||
@@ -1,4 +1,4 @@ | ||
-#!/usr/bin/env sh | ||
+#!/usr/bin/env bash | ||
# shellcheck disable=SC1091 | ||
|
||
# Ignore warning about `local` being undefinded in POSIX | ||
@@ -12,6 +12,8 @@ | ||
export LC_ALL=C | ||
export LC_NUMERIC=C | ||
|
||
+PATH=/opt/bin:/opt/sbin:$PATH | ||
+ | ||
############################################ VARIABLES ############################################# | ||
|
||
# VERSION | ||
@@ -192,8 +194,8 @@ LoginAPI() { | ||
fi | ||
|
||
# Try to read the CLI password (if enabled and readable by the current user) | ||
- if [ -r /etc/pihole/cli_pw ]; then | ||
- password=$(cat /etc/pihole/cli_pw) | ||
+ if [ -r /opt/etc/pihole/cli_pw ]; then | ||
+ password=$(cat /opt/etc/pihole/cli_pw) | ||
# If we can read the CLI password, we can skip 2FA even when it's required otherwise | ||
needTOTP=false | ||
fi | ||
@@ -414,6 +416,7 @@ GetSystemInformation() { | ||
|
||
# CPU temperature and unit | ||
cpu_temp_raw=$(GetPADDValue sensors.cpu_temp) | ||
+ [ "$cpu_temp_raw" == "null" ] && cpu_temp_raw=0 | ||
cpu_temp=$(printf "%.1f" "${cpu_temp_raw}") | ||
temp_unit=$(echo "${padd_data}" | GetPADDValue sensors.unit) | ||
|
||
@@ -1279,8 +1282,8 @@ SizeChecker(){ | ||
# this reduces "flickering" of GenerateSizeDependendOutput() items | ||
# after a terminal re-size | ||
sleep 0.1 | ||
- console_width=$(tput cols) | ||
- console_height=$(tput lines) | ||
+ console_width=$(stty size | cut -d' ' -f2) | ||
+ console_height=$(stty size | cut -d' ' -f1) | ||
|
||
# Mega | ||
if [ "$console_width" -ge "80" ] && [ "$console_height" -ge "26" ]; then | ||
@@ -1759,7 +1762,7 @@ NormalPADD() { | ||
|
||
Update() { | ||
# source version file to check if $DOCKER_VERSION is set | ||
- . /etc/pihole/versions | ||
+ . /opt/etc/pihole/versions | ||
|
||
if [ -n "${DOCKER_VERSION}" ]; then | ||
echo "${check_box_info} Update is not supported for Docker" |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
[ "$(id -u)" -ne 0 ] && { echo "Admin privileges required!"; exit 1; } | ||
! command -v git >/dev/null 2>&1 && { echo "Command 'git' not found!"; exit 1; } | ||
|
||
echo "This script will install and patch PADD." | ||
read -rp "Press Enter to continue..." | ||
|
||
set -e | ||
cd /opt/share/pihole | ||
wget -O padd.sh https://install.padd.sh | ||
chmod +x padd.sh | ||
git apply --include=padd.sh PADD.patch | ||
echo "PADD has been installed. Run 'padd.sh' to start PADD." |
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