Commit cd64589e authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2951 Added documentation and die errors to fusiondirectory-insert-schema

Showing with 12 additions and 4 deletions
+12 -4
...@@ -166,8 +166,9 @@ sub insert_schema ...@@ -166,8 +166,9 @@ sub insert_schema
} }
my $dn_part = $1; my $dn_part = $1;
# if the schema already exists in the LDAP server, modify it # if the schema already exists in the LDAP server, modify it
open(SCHEMA, "<".$path.$schema.".ldif"); open(SCHEMA, "<".$path.$schema.".ldif") or die_with_error('Could not open '."<".$path.$schema.".ldif: $!");
open(UPDATE, ">".$path.$schema."_update.ldif"); open(UPDATE, ">".$path.$schema."_update.ldif") or die_with_error('Could not open '.">".$path.$schema."_update.ldif: $!");
push @gen_files, $path.$schema."_update";
my $attrs = 0; my $attrs = 0;
my $classes = 0; my $classes = 0;
while (<SCHEMA>) { while (<SCHEMA>) {
...@@ -201,6 +202,8 @@ sub insert_schema ...@@ -201,6 +202,8 @@ sub insert_schema
print UPDATE; print UPDATE;
print UPDATE "\n"; print UPDATE "\n";
} }
close SCHEMA;
close UPDATE;
$full_cmd = $mod_cmd.$path.$schema."_update.ldif"; $full_cmd = $mod_cmd.$path.$schema."_update.ldif";
print "executing '$full_cmd'\n"; print "executing '$full_cmd'\n";
if (system ($full_cmd) != 0) { if (system ($full_cmd) != 0) {
...@@ -241,7 +244,7 @@ sub usage ...@@ -241,7 +244,7 @@ sub usage
(@_) && print STDERR "\n@_\n\n"; (@_) && print STDERR "\n@_\n\n";
print STDERR << "EOF"; print STDERR << "EOF";
usage: $0 [-h] [path] [-i schema1 schema2 ] usage: $0 [-h] [-l] [path] [-i|-m schema1 schema2 ]
-h, --help : this (help) message -h, --help : this (help) message
path : where to find the schemas path : where to find the schemas
...@@ -261,12 +264,14 @@ fusiondirectory-insert-schema - insert schema needed by FusionDirectory into the ...@@ -261,12 +264,14 @@ fusiondirectory-insert-schema - insert schema needed by FusionDirectory into the
=head1 SYNOPSIS =head1 SYNOPSIS
fusiondirectory-insert-schema [<path of your schema files>] [-i schema1 schema2] fusiondirectory-insert-schema [<path of your schema files>] [-l] [-i|-m schema1 schema2]
=head1 DESCRIPTION =head1 DESCRIPTION
This program will insert the schema needed by FusionDirectory into the ldap server This program will insert the schema needed by FusionDirectory into the ldap server
If -i is specified, insert the given list of schemas instead of the default list If -i is specified, insert the given list of schemas instead of the default list
If -m is specified, insert the given list of schemas, replacing already inserted versions of those schemas
If -l is specified, list inserted schemas
=head1 EXAMPLES =head1 EXAMPLES
...@@ -282,6 +287,9 @@ If -i is specified, insert the given list of schemas instead of the default list ...@@ -282,6 +287,9 @@ If -i is specified, insert the given list of schemas instead of the default list
fusion@catbert$ fusiondirectory-insert-schema -i myschema fusion@catbert$ fusiondirectory-insert-schema -i myschema
Insert the schema myschema.ldif from working directory Insert the schema myschema.ldif from working directory
fusion@catbert$ fusiondirectory-insert-schema -m /etc/ldap/otherschema/myschema.schema
Convert /etc/ldap/otherschema/myschema.schema to ldif and replace the existing schema by this one
=head1 BUGS =head1 BUGS
Please report any bugs, or post any suggestions, to the fusiondirectory mailing list fusiondirectory-users or to Please report any bugs, or post any suggestions, to the fusiondirectory mailing list fusiondirectory-users or to
......
  • bmortier @bmortier

    mentioned in issue #1014

    By bmortier on 2017-09-02T15:08:47 (imported from GitLab)

    ·

    mentioned in issue #1014

    By bmortier on 2017-09-02T15:08:47 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment