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
[WIP] Store all gravity whitelist and blacklist vars in pihole #826
Conversation
Hotfix for installer bug, MASTER
…le/promoTweaksTheSecond
@@ -53,8 +50,8 @@ HandleOther(){ | |||
|
|||
PopBlacklistFile(){ | |||
#check blacklist file exists, and if not, create it | |||
if [[ ! -f ${blacklist} ]];then | |||
touch ${blacklist} | |||
if [[ ! -f ${blacklistFile} ]];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be in the format of "${blacklistFile}" so that bash doesn't split on space if the filename contains a space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that mistake is all over
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're cleaning up a lot of our messes that we needed to get to, so thank you thank you for that!!
#Source the setupVars from install script for the IP | ||
export setupVars=/etc/pihole/setupVars.conf | ||
|
||
export basename=pihole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe exporting all of these variables and values will leave them in the environment even after the script is finished executing. I'll need to check on that however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pihole -w zzz.clickbank.net > /dev/null ; echo "basename=$basename"
basename=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the env
look like?
probably better to just ignore this one till a few are taken care of first cause i imagin its going to get lots of conflicts |
There's two ways you can put a hold on a merge, you can tag/label |
or i just remove the branch? |
So far there are no conflicts, so I wouldn't close out the PR... |
gonna any ways alot of quotes need fixed 👍 |
export command is used to export a variable or function to the environment of all the child processes running in the current shell. |
So only processes spawned from where its called |
Okay cool, good to know. |
@Mcat12 mostly basename=pihole would be moved to setupVars and setupVars would be sourced from all scripts and basic-install would need to reflect the changes to setupvars |
And the web interface php files would need to take their paths from setupVars |
Haven't looked into that. Should probably build that into pihole script For the list. And use the pihole command to edit |
The web interface already uses the pihole command to edit the lists, but other files are hardcoded, for example gravity.list and the whitelist/blacklist files. |
so, TODO part 2 |
I would start a whole new branch using the latest code, which has the white and black lists in list.sh |
will start on this monday |
By submitting this pull request, I confirm the following (please check boxes, eg [X]):
How familiar are you with the codebase?:
Store all script vars in pihole