#!/bin/sh

DEV_UID=$1
DEV_GID=$2
DEV_MODE=0600

DEVICES="fb0 dsp apm_bios ttyS[0-9] ircomm"

for file in $DEVICES; do
    if [ ! -z $3 ]; then
        echo -n "$file "
    fi
    chown $DEV_UID:$DEV_GID /dev/$file
    chmod $DEV_MODE /dev/$file
done
if [ ! -z $3 ]; then
    echo
fi
