Gnration des fichiers de conf de squid.
darcs-hash:20041017142032-41617-5e9b037884233c2835fc0c68080f1210a1936742.gz
This commit is contained in:
parent
3ca42aa431
commit
1481c22db1
2 changed files with 98 additions and 51 deletions
|
@ -25,9 +25,11 @@ import config
|
|||
|
||||
args_autorises = ['quiet', 'remove=', 'list' ,'help']
|
||||
if hostname == 'zamok' :
|
||||
args_autorises += [ 'home=', 'mail_bienvenue=', 'ML-ENS=', 'droits', 'switch=' , 'dhcp', 'dns', 'firewall' , 'del_user=']
|
||||
args_autorises += [ 'home=', 'mail_bienvenue=', 'ML-ENS=', 'droits', 'switch=' , 'dhcp', 'dns', 'firewall' , 'del_user=', 'blacklist_upload' ]
|
||||
elif hostname == 'nectaris' :
|
||||
args_autorises += [ 'conf_wifi', 'bornes_wifi=' , 'droits-nectaris']
|
||||
elif hostname == 'sila' :
|
||||
args_autorises += [ 'bl_squid_upload', 'blacklist_virus' , 'blacklist_warez' , 'bl_chbre_invalide', 'bl_carte_etudiant' ]
|
||||
|
||||
# On vérifie que l'on est root
|
||||
if os.getuid() != 0:
|
||||
|
@ -209,17 +211,17 @@ if hostname == 'zamok':
|
|||
except:
|
||||
if auto : db.services_to_restart('droits')
|
||||
|
||||
if 'upload' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-upload')
|
||||
# aussi relancer le firewall (+ tard)
|
||||
if 'blacklist_upload' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-blacklist_upload')
|
||||
db.services_to_restart('bl_squid_upload')
|
||||
try:
|
||||
from gen_confs.squid import squid_upload
|
||||
a = squid_upload()
|
||||
from gen_confs.firewall import bl_upload_fw
|
||||
a = bl_upload_fw()
|
||||
a.debug = debug
|
||||
a.reconfigure()
|
||||
except:
|
||||
if auto: db.services_to_restart('upload')
|
||||
|
||||
if auto: db.services_to_restart('blacklist_upload')
|
||||
|
||||
if 'switch' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-switch')
|
||||
try:
|
||||
|
@ -334,7 +336,46 @@ elif hostname == 'sila' :
|
|||
except:
|
||||
if auto: db.services_to_restart('bl_carte_etudiant')
|
||||
|
||||
if 'blacklist_virus' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-blacklist_virus')
|
||||
try:
|
||||
from gen_confs.squid import squid_virus
|
||||
a = squid_virus()
|
||||
a.debug = debug
|
||||
a.reconfigure()
|
||||
except:
|
||||
if auto: db.services_to_restart('blacklist_virus')
|
||||
|
||||
if 'blacklist_warez' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-blacklist_warez')
|
||||
try:
|
||||
from gen_confs.squid import squid_warez
|
||||
a = squid_warez()
|
||||
a.debug = debug
|
||||
a.reconfigure()
|
||||
except:
|
||||
if auto: db.services_to_restart('blacklist_warez')
|
||||
|
||||
if 'bl_squid_upload' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-bl_squid_upload')
|
||||
try:
|
||||
from gen_confs.squid import squid_upload
|
||||
a = squid_upload()
|
||||
a.debug = debug
|
||||
a.reconfigure()
|
||||
except:
|
||||
if auto: db.services_to_restart('bl_squid_upload')
|
||||
|
||||
if 'bl_chbre_invalide' in to_do.keys() :
|
||||
if auto : db.services_to_restart('-bl_chbre_invalide')
|
||||
try:
|
||||
from gen_confs.squid import squid_chbre
|
||||
a = squid_chbre()
|
||||
a.debug = debug
|
||||
a.reconfigure()
|
||||
except:
|
||||
if auto: db.services_to_restart('bl_chbre_invalide')
|
||||
|
||||
if debug :
|
||||
print 'Non traité ici mais signalé dans la base LDAP : \n\t', db.services_to_restart()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue