Merge pull request #607 from pi-hole/Debug_Options

Debug options
This commit is contained in:
Adam Warner 2016-08-05 12:54:55 +01:00 committed by GitHub
commit f49ca48a22
2 changed files with 19 additions and 10 deletions

View file

@ -338,7 +338,16 @@ function dumpPiHoleLog {
# Anything to be done after capturing of pihole.log terminates # Anything to be done after capturing of pihole.log terminates
function finalWork { function finalWork {
echo "::: Finshed debugging!" echo "::: Finshed debugging!"
echo "::: The degug log can be uploaded to Termbin.com for easier sharing."
read -r -p "::: Would you like to upload the log? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999)
;;
*)
echo "::: Log will NOT be uploaded to Termbin."
;;
esac
# Check if termbin.com is reachable. When it's not, point to local log instead # Check if termbin.com is reachable. When it's not, point to local log instead
if [ -n "$TERMBIN" ] if [ -n "$TERMBIN" ]
@ -348,6 +357,7 @@ function finalWork {
echo "::: Debug log can be found at : /var/log/pihole_debug.log" echo "::: Debug log can be found at : /var/log/pihole_debug.log"
fi fi
} }
trap finalWork EXIT trap finalWork EXIT
### Method calls for additional logging ### ### Method calls for additional logging ###

View file

@ -359,7 +359,6 @@ setStaticIPv4() {
$SUDO echo "ONBOOT=yes" >> $IFCFG_FILE $SUDO echo "ONBOOT=yes" >> $IFCFG_FILE
$SUDO echo "IPADDR=$IPADDR" >> $IFCFG_FILE $SUDO echo "IPADDR=$IPADDR" >> $IFCFG_FILE
$SUDO echo "PREFIX=$CIDR" >> $IFCFG_FILE $SUDO echo "PREFIX=$CIDR" >> $IFCFG_FILE
$SUDO echo "GATEWAY=$IPv4gw" >> $IFCFG_FILE
$SUDO echo "USERCTL=no" >> $IFCFG_FILE $SUDO echo "USERCTL=no" >> $IFCFG_FILE
$SUDO ip addr replace dev "$piholeInterface" "$IPv4addr" $SUDO ip addr replace dev "$piholeInterface" "$IPv4addr"
if [ -x "$(command -v nmcli)" ];then if [ -x "$(command -v nmcli)" ];then