Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
Last active June 2, 2016 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brahimmachkouri/92eddb0d29159893b237 to your computer and use it in GitHub Desktop.
Save brahimmachkouri/92eddb0d29159893b237 to your computer and use it in GitHub Desktop.
Webmin install in Debian : wget --no-check-certificate http://j.mp/webmindebianinstaller
#!/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