31 lines
858 B
Python
Executable File
31 lines
858 B
Python
Executable File
#!/usr/bin/python3.5
|
|
|
|
# DEBUG
|
|
import cgitb
|
|
cgitb.enable()
|
|
|
|
# IMPORT DES MODULES
|
|
import configparser
|
|
import os
|
|
from functions.headfoot import printheader,printfooter
|
|
# IMPORT DE LA CONFIGURATION
|
|
config = configparser.ConfigParser()
|
|
config.read('config.conf')
|
|
|
|
DOMAIN = config.get('general','domain')
|
|
PROTO = config.get('general','proto')
|
|
|
|
# AFFICHAGE DES ENTETES
|
|
printheader()
|
|
|
|
# BODY
|
|
print('<a href="http://', DOMAIN , '/new.py">Nouveau VHOST</a>', "<br>" , sep='' )
|
|
|
|
for i in sorted(os.listdir("/etc/apache2/sites-available")):
|
|
if os.path.isfile("/etc/apache2/sites-enabled/" + i):
|
|
print('<a href="', PROTO , '://', DOMAIN, '/file.py?file=',i, '">', i ,'</a> is enable!<br>', sep='')
|
|
else:
|
|
print('<a href="', PROTO , '://', DOMAIN, '/file.py?file=',i, '">', i ,'</a> is disable!<br>', sep='')
|
|
# AFFICHAGE DES FOOTERS
|
|
printfooter()
|