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

Use pihole checkout for development checkout #227

Merged
merged 3 commits into from
Jan 31, 2018
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
25 changes: 15 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -ex
mkdir -p /etc/pihole/
mkdir -p /var/run/pihole
export CORE_TAG='v3.2.1'
export WEB_TAG='v3.2.1'
export FTL_TAG='v2.13.2'
Expand Down Expand Up @@ -38,15 +39,6 @@ webInterfaceGitUrl="${webInterfaceGitUrl}"
webInterfaceDir="${webInterfaceDir}"
git clone "${piholeGitUrl}" "${PI_HOLE_LOCAL_REPO}"
git clone "${webInterfaceGitUrl}" "${webInterfaceDir}"
if [[ $USE_DEVELOPMENT_BRANCHES == true ]] ; then
pushd "${PI_HOLE_LOCAL_REPO}"; git checkout development; popd;
pushd "${webInterfaceDir}"; git checkout devel; popd;
else
pushd "${PI_HOLE_LOCAL_REPO}";
git reset --hard "${CORE_TAG}";
popd;
pushd "${webInterfaceDir}"; git reset --hard "${WEB_TAG}"; popd;
fi

export PIHOLE_INTERFACE=eth0
export IPV4_ADDRESS=0.0.0.0
Expand All @@ -58,13 +50,26 @@ export QUERY_LOGGING=true
tmpLog="/tmp/pihole-install.log"
installLogLoc="${installLogLoc}"
installPihole | tee "${tmpLog}"
mv "${tmpLog}" /

if [[ $USE_DEVELOPMENT_BRANCHES == true ]] ; then
ln -s /bin/true /usr/local/bin/service
echo y | bash -x pihole checkout core development
echo y | bash -x pihole checkout web devel
echo y | bash -x pihole checkout ftl development
unlink /usr/local/bin/service
else
# Reset to our tags so version numbers get detected correctly
pushd "${PI_HOLE_LOCAL_REPO}"; git reset --hard "${CORE_TAG}"; popd;
pushd "${webInterfaceDir}"; git reset --hard "${WEB_TAG}"; popd;
fi

sed -i 's/readonly //g' /opt/pihole/webpage.sh

sed -i $'s/helpFunc() {/unsupportedFunc() {\\\n echo "Function not supported in Docker images"\\\n exit 0\\\n}\\\n\\\nhelpFunc() {/g' /usr/local/bin/pihole
# Replace references to `updatePiholeFunc` with new `unsupportedFunc`
sed -i $'s/updatePiholeFunc;;/unsupportedFunc;;/g' /usr/local/bin/pihole

mv "${tmpLog}" /
touch /.piholeFirstBoot

# Fix dnsmasq in docker
Expand Down