pyth0n3 Posted November 6, 2010 Report Posted November 6, 2010 (edited) Nu face nimic special , descarca ?i instaleaz? ultima versiune de firefox în LinuxNu are nici un fel de op?iune , va descarca ultima versiune 3.6.x în limba englezaUneori are o mica problema de conexiune cu serverul ftp de la Mozilla dar mergel-am scris deoarece în debian ar trebui sa fac update de fiecare data manual cînd apare o noua versiune de firefoxDaca nu fac update îmi apar o gr?mad? de pop-up care îmi spun ca exista o noua versiune#!/usr/bin/python#Date:6.11.2010#Purpose: Download and install latest US firefox in Linux #Author: pyth0n3 #Blog: http://pyth0n3.blogspot.com/import osimport ftplibimport globimport tarfileimport shutilimport time import sysprint "[+]This script will download && install the latest 3.6.x firefox USversion for Linux" var = raw_input ("Do you want to continue?Type |yes/no| : ")if var.lower() == "no": sys.exit()elif var.lower() == 'yes' : ###making a temp directory in local print "[+]Creating a temporary directory for work.. " time.sleep(2) if not os.path.exists("/tmp/firefox"): os.mkdir("/tmp/firefox") os.chdir("/tmp/firefox/") print "[+]Connecting..." ftp = ftplib.FTP("releases.mozilla.org") ftp.login("anonymous", "anonymous") directory = '/pub/mozilla.org/firefox/releases/latest-3.6/linux-i686/en-US/' match = '*.bz2' ftp.cwd(directory) print "[+]Searching the latest version..." for f1 in ftp.nlst(match): var = open(f1, 'wb') print '[+]Downloading ' + f1 ,'Please wait...' ftp.retrbinary('RETR ' + f1, var.write) var.close() print "[+]Extracting files... " def extract_file(path, dst='/usr/lib/'): if path.endswith('.tar.bz2'): opener, mode = tarfile.open, 'r:bz2' cwd = os.getcwd() os.chdir(dst) try: file = opener(path, mode) try: file.extractall() finally: file.close() finally: os.chdir(cwd) var1 = glob.glob('/tmp/firefox/*.bz2') var2 = ','.join(var1) extract_file (var2) print "[+]Setting up the browser..." time.sleep(3) os.symlink("/usr/lib/firefox/firefox", "/usr/bin/firefox") print "[+]Removing temporary files..." shutil.rmtree("/tmp/firefox") print '[+]Done'sys.exit()#END#wget http://sprunge.us/EZGX -O getfox.py Edited November 10, 2010 by pyth0n3 1 Quote