summaryrefslogtreecommitdiff
path: root/comms/ltmdm/files/ltmdm.sh
blob: 9eca81695a7d7c3fb575be79e4429a2c9538d248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

PREFIX=%%PREFIX%%
MAJOR=%%MAJOR%%

if mount -p | awk '{print $3}'| grep -q devfs ; then
  HAVEDEVFS=YES
else
  HAVEDEVFS=NO
fi

case "$1" in
  stop)
    if [ "${HAVEDEVFS}" = "NO" ]; then
      rm -f /dev/cual0 /dev/cuail0 /dev/cuall0 /dev/ttyl0 /dev/ttyil0 /dev/ttyll0
    fi
    kldstat -n ltmdm 2>/dev/null >/dev/null && kldunload ltmdm
    ;;
  start|restart)
    $0 stop
    sleep 1
    if [ "${HAVEDEVFS}" = "NO" ]; then
      umask 7
      mknod /dev/cual0  c ${MAJOR} 128 uucp:dialer
      mknod /dev/cuail0 c ${MAJOR} 160 uucp:dialer
      mknod /dev/cuall0 c ${MAJOR} 192 uucp:dialer
      umask 77
      mknod /dev/ttyl0  c ${MAJOR} 0  root:wheel
      mknod /dev/ttyil0 c ${MAJOR} 32 root:wheel
      mknod /dev/ttyll0 c ${MAJOR} 64 root:wheel
    fi

    kldload ${PREFIX}/share/ltmdm/ltmdm.ko
    echo -n ' ltmdm'
    ;;
esac