#!/bin/sh

TEVA_LIB_PATH=/var/lib/teva/

# Configuring ttyS*: disabling serial ttys if they don't exist in the device
mkdir -p $TEVA_LIB_PATH
for i in 0 1; do
    ENABLE_FILE="$TEVA_LIB_PATH/enable-ttyS${i}"
    if /bin/setserial -g "/dev/ttyS${i}" | grep -q unknown ; then
        rm -f "$ENABLE_FILE"
    else
        touch "$ENABLE_FILE"
    fi
done
