Alpha first commit
This commit is contained in:
30
index.py
Executable file
30
index.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/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 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()
|
Reference in New Issue
Block a user