diff --git a/root/SCRIPTs/Upgrade.sh b/root/SCRIPTs/Upgrade.sh index 77cee38..d42656b 100755 --- a/root/SCRIPTs/Upgrade.sh +++ b/root/SCRIPTs/Upgrade.sh @@ -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 git@github.com:DNSCrypt/dnscrypt-proxy.git" git clone git@github.com: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