Compare commits

...

3 Commits

Author SHA1 Message Date
66b42612f9 update 2021-05-11 09:49:27 +02:00
29717432ae add del_zephir 2021-05-11 09:38:10 +02:00
029380c75f corrections 2021-05-11 09:20:29 +02:00
4 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,54 @@
from zephir.lib_zephir import *
import os, shutil
from creole.config import eoledirs, distrib_dir, dicos_dir
from creole.client import CreoleClient, NotFoundError
from pyeole.service import manage_service, unmanaged_service
creole_client = CreoleClient()
try:
eole_module = creole_client.get_creole('eole_module')
eole_version = creole_client.get_creole('eole_release')
except Exception, exc:
print_red("\nErreur d'accès au service creoled :\n\n")
print str(exc)
exit(1)
stats_running = False
stats_service = u'z_stats'
if os.path.isfile('/var/run/z_stats.pid'):
stats_running = True
try:
from zephir.zephir_conf import zephir_conf
except:
zephir_conf = None
if stats_running:
manage_service(u'stop', stats_service)
if eole_module != 'zephir':
if zephir_conf is not None:
# agents de surveillance : on réinitialise le n° de l'agent à 0 pour les stats
# si il existe déjà
stats_dir = '%s/monitor/stats/' % zephir_dir
# ancien répertoire de stockage
old_id = str(zephir_conf.id_serveur)
if os.path.isdir(stats_dir + old_id):
shutil.move(stats_dir + old_id, stats_dir + '0')
try:
os.unlink("%s/zephir_conf/zephir_conf.py" % zephir_path)
except:
print("\n !! le fichier %s/zephir_conf/zephir_conf.py n'a pas pu être supprimé !!\n" % zephir_d_path)
try:
os.unlink("%s/zephir_conf/zephir_conf.pyc" % zephir_path)
try:
f=file("%s/deffered_logs" % zephir_dir, "w")
f.close()
shutil.rmtree("/var/spool/uucp/zephir")
except:
pass
except:
pass
if stats_running:
manage_service(u'start', stats_service)

View File

@ -23,7 +23,7 @@ from zephir.lib_zephir import flushed_input
def display_help():
print("Sauvegarde une cle ssh d'un utilisateur dans Zephir")
print("{} [utilisaeur] [--key chemin_de_la_clé]".format(sys.argv[0]))
print("{} [utilisateur] [--key chemin_de_la_clé]".format(sys.argv[0]))
def argparser():