-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use variables for redondent files & directories
- Loading branch information
1 parent
886a508
commit 601f589
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,11 @@ if [[ ${gbRepoUpgrade_Enable:-0} -eq 1 ]]; then | |
fi | ||
|
||
#### DNScrypt-proxy v2 | ||
sGenerateDomainsBlacklistDir="${gsDirOverLoad}/dnscrypt/generate-domains-blocklist" | ||
sDomainsBlacklistScriptname='generate-domains-blocklist.py' | ||
sDomainsBlacklistConfigname='domains-blocklist.conf' | ||
sGenerateDomainsBlacklistScript="${sGenerateDomainsBlacklistDir%/}/${sDomainsBlacklistScriptname}" | ||
sDomainsBlacklistConfigFile="${gsDirOverLoad}/dnscrypt/generate-domains-blocklist/${sDomainsBlacklistConfigname}" | ||
if [[ ! -d /opt/usr/local/dnscrypt-proxy ]]; then | ||
logger -p user.notice "| ${gsScriptName} | Git clone [email protected]:DNSCrypt/dnscrypt-proxy.git" | ||
git clone [email protected]:DNSCrypt/dnscrypt-proxy.git "${gsDirDnscrypt:?}" | ||
|
@@ -46,16 +51,16 @@ else | |
git fetch origin | ||
git reset --hard origin/master | ||
# git pull origin master | ||
[[ -f ${gsDirDnscryptGen}/generate-domains-blocklist.py ]] && { | ||
mkdir -p "${gsDirOverLoad}"/dnscrypt/generate-domains-blocklist | ||
cp -v "${gsDirDnscryptGen}"/generate-domains-blocklist.py "${gsDirOverLoad}"/dnscrypt/generate-domains-blocklist/generate-domains-blocklist.py | ||
chmod +x "${gsDirOverLoad}"/dnscrypt/generate-domains-blocklist/generate-domains-blocklist.py | ||
[[ -f ${gsDirDnscryptGen}/${sDomainsBlacklistScriptname} ]] && { | ||
mkdir -p "${sGenerateDomainsBlacklistDir%/}" | ||
cp -v "${gsDirDnscryptGen}/${sDomainsBlacklistScriptname}" "${sGenerateDomainsBlacklistScript}" | ||
chmod +x "${sGenerateDomainsBlacklistScript}" | ||
} | ||
fi | ||
if [[ -f ${gsDirOverLoad}/dnscrypt/generate-domains-blocklist/generate-domains-blocklist.py && -f ${gsDirOverLoad}/dnscrypt/generate-domains-blocklist/domains-blocklist.conf ]]; then | ||
cd "${gsDirOverLoad}"/dnscrypt/generate-domains-blocklist/ || exit 1 | ||
logger -p user.notice "| ${gsScriptName} | Generate 'blacklists.txt' with 'generate-domains-blocklist.py'" | ||
python generate-domains-blocklist.py -c domains-blocklist.conf >list.txt.tmp && mv -f list.txt.tmp blacklists.txt | ||
if [[ -f ${sGenerateDomainsBlacklistScript} && -f ${sDomainsBlacklistConfigFile} ]]; then | ||
cd "${sGenerateDomainsBlacklistDir%/}"/ || exit 1 | ||
logger -p user.notice "| ${gsScriptName} | Generate 'blacklists.txt' with '${sDomainsBlacklistScriptname}'" | ||
python "${sDomainsBlacklistScriptname}" -c "${sDomainsBlacklistConfigname}" >list.txt.tmp && mv -f list.txt.tmp blacklists.txt | ||
fi | ||
|
||
#### SCRIPTs | ||
|