This adds an extra subcommand: compare: shows span that have been
configured (in /etc/dahdi/span_types.conf) to a different value than
the one currently active on the system.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Better defaults:
- A wildcard match:
- If '--line-mode' option is given, generate a wildcard entry.
(existing behavior).
- Otherwise, if *all spans* are of the same type (E1/T1),
generate a wildcard entry for this type.
This is the most common use-case and now it work without
any command line flags.
- Otherwise (mixed E1/T1 spans), do not generate a wildcard entry.
This isn't common case (except from our labs), but regardless
without '--line-mode' any guess could be wrong.
- Specific device matches:
- If all spans are of the same type, generate commented out
specific entries (for manual overrides).
- If spans have mixed E1/T1 types, generate specific entries
In this case, specific entries MUST NOT be commented out
otherwise, the configuration file is wrong!
* Generated header with better organization:
- Shows what is generated:
- Generating wildcard / Not generating wildcard
- Generating specific lines / Generating *commented-out* specific lines
- For each decision, show *why* it was taken.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Don't warn when a sysfs attribute does not exist.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>
* Add '--line-mode=<E1|T1|J1>' option to dahdi_span_types:
- Will first generate a wildcard entry (* *:<type>)
- All later entries will be commented-out.
- Manually uncommenting any of them will create an "override"
(e.g: mixed system with all spans T1, but some E1)
* Now dahdi_genconf does not generate span-types.conf by default:
- Added '--line-mode=<E1|T1|J1>' option to trigger generation
- This parameter will be passed to "dahdi_span_types dumpconfig"
- Also explicit specification of 'spantypes' as an argument will
trigger a similar generation (with a default of 'E1').
- The line-mode may also be passed to the generator directly
with identical results. Example:
dahdi_genconf spantypes=line-mode=T1
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>
* Allow wildcards for both device and span number (as before).
Example:
* *:T1
* But now we are carefull to follow strict order in the configuration
file. This means, if there are multiple matches -- last one wins.
* So we can use specialisation:
* *:T1 # Everything is T1
FOO [34]:T1 # Except spans 3,4 on the FOO device
* Added --dry-run and --verbose options.
* Updated the man-page:
- Fixed "registered" => "assigned".
- Use "line mode" for E1/J1/T1.
- Document current changes.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>
Makes similar in for the dahdi_span_assignments in that the location of the
default configuration file is shown in the help screen.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
If there are no dahdi devices, $devbase/* expans to have a literal '*',
which leads to warnings such as:
/usr/sbin/dahdi_span_types: 1: cd: can't cd to /sys/bus/dahdi_devices/devices/*
Let's just avoid those.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
The environment variables that specified the full path the the configuration
files for dahdi_span_types and dahdi_span_assignments was documented, but they
were not actually set from the environment.
Also, the case of the variable was changed to match the one for the directory
where the rest of the config files are located.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
All new dahdi tools and utilities will be prefixed with "dahdi_" in order to
avoid any future conflicts with other packages.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>