You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
586 B
33 lines
586 B
#! /bin/sh
|
|
|
|
devbase='/sys/bus/dahdi_devices/devices'
|
|
|
|
# Use given devices or otherwise, all existing devices
|
|
if [ "$#" -gt 0 ]; then
|
|
DEVICES="$@"
|
|
else
|
|
DEVICES=`echo $devbase/*`
|
|
fi
|
|
|
|
run_action_spans() {
|
|
device="$1"
|
|
for span in $device/span-*
|
|
do
|
|
spanno=`echo "$span" | sed 's,.*/span-,,'`
|
|
spantype=`cat "$span/spantype"`
|
|
basechan=`cat "$span/basechan"`
|
|
channels=`cat "$span/channels"`
|
|
endchan=`expr "$basechan" + "$channels" - 1`
|
|
echo "-S $spanno -C $basechan-$endchan"
|
|
done
|
|
}
|
|
|
|
run_action() {
|
|
for device in $DEVICES
|
|
do
|
|
run_action_spans "$device"
|
|
done
|
|
}
|
|
|
|
run_action
|