Last active
June 2, 2016 08:11
-
-
Save brahimmachkouri/92eddb0d29159893b237 to your computer and use it in GitHub Desktop.
Webmin install in Debian : wget --no-check-certificate http://j.mp/webmindebianinstaller
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
#!/usr/bin/python | |
# Brahim MACHKOURI | |
import subprocess | |
import re | |
import urllib2 | |
# recupere la page web de webmin dediee a debian | |
response = urllib2.urlopen('http://www.webmin.com/deb.html') | |
html = response.read() | |
# recherche de la chaine (expression reguliere) | |
version='dpkg --install webmin_(.*?)_all\\.deb' | |
regexp = re.compile(version) | |
result = regexp.search(html) | |
# traitement du resultat | |
if result: | |
var = result.group(1) | |
# verifie qu'il n'y a que des chiffres | |
if any(c.isalpha() for c in var) is False: | |
print "Webmin last version : " + var | |
# installation de webmin | |
subprocess.call('apt-get install --yes perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python',shell=True) | |
subprocess.call('wget http://prdownloads.sourceforge.net/webadmin/webmin_' + var + '_all.deb ',shell=True) | |
subprocess.call('dpkg --install webmin_' + var + '_all.deb',shell=True) | |
subprocess.call('rm -f webmin_' + var + '_all.deb ',shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment