Inject unsupportedFunc into pihole file, replace reference to updatePiholeFunc

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner 2018-01-01 17:18:29 +00:00
parent d9fa9b1016
commit 9ed6bf153c
No known key found for this signature in database
GPG Key ID: F5410858022DA5EB
1 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,13 @@ tmpLog="/tmp/pihole-install.log"
installLogLoc="${installLogLoc}"
installPihole | tee "${tmpLog}"
sed -i 's/readonly //g' /opt/pihole/webpage.sh
# Base pihole functions such as `pihole -up` are unsupported in docker. Replace them in the `pihole` file
# First inject a new function to `pihole` file above the `helpFunc()` function
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
if [[ "$TAG" == 'alpine' ]] ; then
cp /etc/.pihole/advanced/pihole.cron /etc/crontabs/pihole