Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if this is a Pi-hole instead of throwing a random error #297

Merged
merged 2 commits into from
Dec 17, 2022
Merged
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
21 changes: 14 additions & 7 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1059,15 +1059,15 @@ OutputJSON() {
}

StartupRoutine(){
# Get config variables
# Get config variables
. /etc/pihole/setupVars.conf

# Clear the screen and move cursor to (0,0).
# This mimics the 'clear' command.
# https://vt100.net/docs/vt510-rm/ED.html
# https://vt100.net/docs/vt510-rm/CUP.html
# E3 extension `\e[3J` to clear the scrollback buffer see 'man clear'
printf '\e[H\e[2J\e[3J'
# Clear the screen and move cursor to (0,0).
# This mimics the 'clear' command.
# https://vt100.net/docs/vt510-rm/ED.html
# https://vt100.net/docs/vt510-rm/CUP.html
# E3 extension `\e[3J` to clear the scrollback buffer see 'man clear'
printf '\e[H\e[2J\e[3J'

# adds the y-offset
moveYOffset
Expand Down Expand Up @@ -1274,6 +1274,13 @@ main(){
# Trap on exit
trap 'CleanExit' INT TERM EXIT

# If setupVars.conf is not present, then PADD is not running on a Pi-hole
# and we are not able to start as StartupRoutine() will fail below
if [ ! -f /etc/pihole/setupVars.conf ]; then
printf "%b" "${check_box_bad} Error!\n PADD only works in conjunction with Pi-hole!\n"
exit 1
fi

SizeChecker

StartupRoutine ${padd_size}
Expand Down