Skip to content

Commit

Permalink
Merge pull request #227 from diginc/use_pihole_checkout
Browse files Browse the repository at this point in the history
Use pihole checkout for development checkout
  • Loading branch information
diginc authored Jan 31, 2018
2 parents 1f176da + 492b6f6 commit d5db4f4
Showing 1 changed file with 15 additions and 10 deletions.
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

0 comments on commit d5db4f4

Please sign in to comment.