Skip to content

Commit

Permalink
Check if this is a Pi-hole instead of throwing a random error
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Dec 17, 2022
1 parent 6676f56 commit 6147d44
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1064,15 +1064,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 @@ -1270,6 +1270,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 is only works in conjunction with Pi-hole!\n"
exit 1
fi

SizeChecker

StartupRoutine ${padd_size}
Expand Down

0 comments on commit 6147d44

Please sign in to comment.