#!/bin/sh

# Generate static device file nodes for dahdi
# Most peopel won't need this, as the device file nodes are normally
# generated by udev. Also note that if you do use udev, /dev is a 
# ramdisk, and thus any changes you do to it will not be preserved
# on next boot.

mknod_safe() {
	if [ -c $1 ]; then return; fi
	mknod "$@" || true
}

mkdir -p /dev/dahdi
mknod_safe /dev/dahdi/ctl c 196 0
mknod_safe /dev/dahdi/transcode c 196 250
mknod_safe /dev/dahdi/timer c 196 253
mknod_safe /dev/dahdi/channel c 196 254
mknod_safe /dev/dahdi/pseudo c 196 255
for N in `seq 249`; do
        mknod_safe /dev/dahdi/$N c 196 $N
done
chown -R 0:dialout /dev/dahdi/
chmod 0660 /dev/dahdi/*

