[ressuscite_lc] wrapper tout con vers la fonction de resurrection de lc_ldap
This commit is contained in:
parent
37bd7101b2
commit
ae872e5d70
2 changed files with 21 additions and 0 deletions
18
gestion/ressuscite_lc.py
Executable file
18
gestion/ressuscite_lc.py
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
|
import lc_ldap.shortcuts
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) >=2:
|
||||||
|
conn=lc_ldap.shortcuts.lc_ldap_admin()
|
||||||
|
for file in sys.argv[1:]:
|
||||||
|
try:
|
||||||
|
conn.ressuscite(file)
|
||||||
|
except lc_ldap.attributs.UniquenessError as e:
|
||||||
|
sys.stderr.write("%s\n" % e)
|
||||||
|
|
||||||
|
else:
|
||||||
|
sys.stderr.write("Usage: %s [fichier_du_cimetière]*\nLe cimetière est dans /home/cimetiere_lc/\n" % sys.argv[0])
|
3
respbats/ressuscite_lc
Executable file
3
respbats/ressuscite_lc
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/ressuscite_lc.py $*
|
Loading…
Add table
Add a link
Reference in a new issue