# # AutoPac_EN.sh # Author: Henry Hertz Hobbit # Version: 3.2.0 # 2012-03-24 23:27 UTC # # http://www.gnu.org/licenses/lgpl.txt # # This script file provides a way to automatically upgrade the # PAC filters via UnixUtils. You MUST install UnixUtils first # though. See the UtilsSetup.txt file in the # UnixUtilsInstallation to do that. The alternative is to use # the full version of CygWin. For Windows users that is # overkill. # CURDIR=`pwd` cd ${SYSTEMDRIVE} cd / if [ -f /usr/local/wbin/sha1sum.exe ] then CHECKSUMPROG=sha1sum CHECKSUMDATA=sums.sha1 echo using SHA1 check sums else CHECKSUMPROG=md5sum CHECKSUMDATA=sums.md5 echo using MD5 check sums fi # DEPRECATED - hostsfile.org is no more # Do some primitive load balancing for which host we pull files from. # The last else clause is for when nothing is there yet. # if [ -f /etc/LastUsedSMPAC.txt ] # then # rm -f /etc/LastUsedSMPAC.txt # touch /etc/LastUsedHFPAC.txt # DOWNLOADHOST=www.hostsfile.org # else # if [ -f /etc/LastUsedHFPAC.txt ] # then # rm -f /etc/LastUsedHFPAC.txt # touch /etc/LastUsedSMPAC.txt # DOWNLOADHOST=www.securemecca.com # else # touch /etc/LastUsedSMPAC.txt # DOWNLOADHOST=www.securemecca.com # fi # fi if [ -f /etc/LastUsedSMPAC.txt ] then rm -f /etc/LastUsedSMPAC.txt fi if [ -f /etc/LastUsedHFPAC.txt ] then rm -f /etc/LastUsedHFPAC.txt fi DOWNLOADHOST=www.securemecca.com DOUPDATE=1 if [ ! -d etc ] then mkdir etc DOUPDATE=0 fi if [ ! -d etc ] then echo echo THE SCRIPT FAILED echo echo Press Enter to exit read TOLKEIN exit 1 fi # If we are up to date then exit wget -q ${DOWNLOADHOST}/Downloads/pdate.txt if [ -f pdate.txt ] then if [ -f /etc/pdate.txt ] then if diff /etc/pdate.txt pdate.txt then rm -f pdate.txt echo THE PAC FILTER HAS NOT CHANGED echo Press Enter to exit echo read TOLKEIN exit 0 fi fi cp -fp pdate.txt /etc/pdate.txt fi rm -f pdate.txt cd etc rm -fr AutoPac_EN.msw rm -f AutoPac_EN.msw.* # 2011-10 Microsoft Windows BUG if [ ! -d OneFile ] then mkdir OneFile fi if [ -f "${ProgramFiles}\7-Zip\7z.exe" ] && [ ! -f 7z.exe ] then cp -f "${ProgramFiles}\7-Zip\7z.exe" 7z.exe wget -q ${DOWNLOADHOST}/Downloads/AutoPac_EN.msw.7z ./7z.exe x AutoPac_EN.msw.7z rm -f 7z.exe else wget -q ${DOWNLOADHOST}/Downloads/AutoPac_EN.msw.zip unzip AutoPac_EN.msw.zip fi rm -f AutoPac_EN.msw.* if [ -d AutoPac_EN.msw ] then cd AutoPac_EN.msw # If you use http://www.securemecca.com/public/UnixUtils/UnxUtils.zip # and have sha1sum.exe then it uses that. Otherwise it uses the older # md5sum.exe. if ${CHECKSUMPROG} -c ${CHECKSUMDATA} then echo checksums are okay ... installing echo cd .. case ${DOUPDATE} in 1) touch SaveRules.txt rm -f oldproxy_en.txt rm -f olddbgproxy_en.txt if [ -f proxy_en.txt ] then grep -U PERSONAL proxy_en.txt >> SaveRules.txt mv proxy_en.txt oldproxy_en.txt fi if [ -f dbgproxy_en.txt ] then grep -U PERSONAL dbgproxy_en.txt >> SaveRules.txt mv dbgproxy_en.txt olddbgproxy_en.txt fi ;; *) ;; esac cp -p AutoPac_EN.msw/proxy_en.txt proxy_en.txt # cp -p AutoPac_EN.msw/proxy_en.txt proxy.txt cp -p AutoPac_EN.msw/dbgproxy_en.txt dbgproxy_en.txt # cp -p AutoPac_EN.msw/dbgproxy_en.txt dbgproxy.txt cp -p AutoPac_EN.msw/pornproxy_en.txt pornproxy_en.txt # 2011-10 Microsoft Windows BUG # if [ -d OldFile ] # then cp -p AutoPac_EN.msw/proxy_en.txt OneFile/proxy_en.txt # fi if [ -f AutoPac_EN_Old.sh ] then echo You have a new AutoPac_EN.sh in the AutoPac_EN.msw folder. echo Replace your current AutoPac_EN.sh with the new one ASAP. echo fi echo Installation complete. Leaving AutoPac_EN.msw with OpenPGP echo Encryption signature for stronger verification. echo else echo the checksums FAILED ... exiting echo fi else echo FAILED to either pull down file or unpack it. echo fi echo Press Enter to exit echo read TOLKEIN cd ${CURDIR} exit