mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-25 16:50:14 +00:00
Actually get is_repo
to return a value and have it expected.
This commit is contained in:
parent
34482c5ed6
commit
9ec5bbd560
1 changed files with 5 additions and 11 deletions
|
@ -22,18 +22,12 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
||||||
is_repo() {
|
is_repo() {
|
||||||
# Use git to check if directory is currently under VCS
|
# Use git to check if directory is currently under VCS
|
||||||
local directory="${1}"
|
local directory="${1}"
|
||||||
echo -n "::: Checking if ${directory} is a repo... "
|
|
||||||
cd "${directory}" &> /dev/null || false
|
cd "${directory}" &> /dev/null || false
|
||||||
if [[ $(git status --short &> /dev/null) -eq 0 ]]; then
|
$(git status --short &> /dev/null)
|
||||||
echo "OK"
|
return
|
||||||
true
|
|
||||||
else
|
|
||||||
echo "not found!"
|
|
||||||
false
|
|
||||||
fi;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
make_repo() {
|
make_repo() {
|
||||||
# Remove the non-repod interface and clone the interface
|
# Remove the non-repod interface and clone the interface
|
||||||
echo -n "::: Cloning $2 into $1..."
|
echo -n "::: Cloning $2 into $1..."
|
||||||
rm -rf "${1}"
|
rm -rf "${1}"
|
||||||
|
@ -65,14 +59,14 @@ getGitFiles() {
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
is_repo "${PI_HOLE_FILES_DIR}"
|
is_repo "${PI_HOLE_FILES_DIR}"
|
||||||
if [[ $? -eq 1 ]]; then #This is unlikely
|
if [[ $? -ne 0 ]]; then #This is unlikely
|
||||||
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
||||||
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
is_repo "${ADMIN_INTERFACE_DIR}" &> /dev/null
|
is_repo "${ADMIN_INTERFACE_DIR}" &> /dev/null
|
||||||
if [[ $? -eq 1 ]]; then #This is unlikely
|
if [[ $? -ne 0 ]]; then #This is unlikely
|
||||||
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
echo "::: Critical Error: Pi-Hole repo missing from system!"
|
||||||
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue