~ubuntu-branches/ubuntu/saucy/dahdi-tools/saucy-proposed

« back to all changes in this revision

Viewing changes to dahdi_cfg_device_args

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-08-25 12:48:37 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130825124837-wtefi7f9dsihg8is
Tags: 1:2.7.0-1ubuntu1
* Merge from debian. Remaining changes:
  - debian/control: Added gawk as dependency for dkms build
  - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source
  - debian/control: Set ubuntu maintainer    
  - added debian/dahdi.postinst
  - debian/control: Removed Uploaders field.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
devbase='/sys/bus/dahdi_devices/devices'
 
4
 
 
5
# Use given devices or otherwise, all existing devices
 
6
if [ "$#" -gt 0 ]; then
 
7
        DEVICES="$@"
 
8
else
 
9
        DEVICES=`echo $devbase/*`
 
10
fi
 
11
 
 
12
run_action_spans() {
 
13
        device="$1"
 
14
        for span in $device/span-*
 
15
        do
 
16
                spanno=`echo "$span" | sed 's,.*/span-,,'`
 
17
                spantype=`cat "$span/spantype"`
 
18
                basechan=`cat "$span/basechan"`
 
19
                channels=`cat "$span/channels"`
 
20
                endchan=`expr "$basechan" + "$channels" - 1`
 
21
                echo "-S $spanno -C $basechan-$endchan"
 
22
        done
 
23
}
 
24
 
 
25
run_action() {
 
26
        for device in $DEVICES
 
27
        do
 
28
                run_action_spans "$device"
 
29
        done
 
30
}
 
31
 
 
32
run_action