~ubuntu-branches/ubuntu/vivid/dahdi-tools/vivid

« back to all changes in this revision

Viewing changes to xpp/waitfor_xpds

  • Committer: Package Import Robot
  • Author(s): Stefan Bader
  • Date: 2014-12-10 15:23:10 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20141210152310-6qv78czvvxpye2v3
Tags: 1:2.10.0.1-1ubuntu1
* Merge from Debian. Remaining changes:
  - debian/control: Depend on (dahdi-dkms | dahdi-source) and gawk
* Dropped changes:
  - debian/dahdi.postinst: Upstream init script does not fail if no
    dahdi modules are present, so no use for the error handler in the
    postinst file.
  - debian/rules: For the same reason no need to set an error handler
    in the rules file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
}
42
42
 
43
43
ab_serial_nums() {
44
 
        ab_list | \
45
 
                sed 's,$,/serial,' | \
46
 
                xargs grep -H '' 2>/dev/null | \
47
 
                sed 's,.*/serial:,,' | \
48
 
                sed 's/^$/NO-SERIAL/' | \
49
 
                sort -u
 
44
        for i in `ab_list`; do
 
45
                s=`cat "$i/serial" 2>/dev/null` || :
 
46
                if [ "$s" = '' ]; then
 
47
                        echo "NO-SERIAL"
 
48
                else
 
49
                        echo "$s"
 
50
                fi
 
51
        done | sort -u || :
50
52
}
51
53
 
52
54
detected_serial_nums() {
53
 
        cat /sys/bus/astribanks/devices/*/transport/serial 2> /dev/null | \
54
 
                sed 's/^$/NO-SERIAL/' | \
55
 
                sort -u || :
 
55
        for i in /sys/bus/astribanks/devices/*/transport; do
 
56
                s=`cat "$i/serial" 2>/dev/null` || :
 
57
                if [ "$s" = '' ]; then
 
58
                        echo "NO-SERIAL"
 
59
                else
 
60
                        echo "$s"
 
61
                fi
 
62
        done | sort -u || :
56
63
}
57
64
 
58
65
calc_union() {
72
79
                fi
73
80
                test "$oldab" != "$ab"
74
81
        do
 
82
                if [ "$ab" = '' ]; then
 
83
                        echo >&2 "Astribanks disappeared"
 
84
                        break
 
85
                fi
75
86
                oldab="$ab"
76
87
                cat $ab
77
88
                #echo -n 1>&2 "_"
94
105
        exit 0
95
106
fi
96
107
 
 
108
# Sanity check
 
109
for i in `ab_list`; do
 
110
        s=`cat "$i/serial" 2>/dev/null` || :
 
111
        if [ "$s" = '' ]; then
 
112
                echo >&2 "WARNING! Astribank without serial number: $i"
 
113
        fi
 
114
done
 
115
 
97
116
serial_nums=`ab_serial_nums`
98
117
 
99
118
# Loop until detected (hopefully) all astribanks and they are initialized