#!/bin/sh

# Turn bell off
xset b off

# If ogain is present, make sure its turned up
MIXOUT="`mixer -s`"
echo $MIXOUT | grep "ogain " >/dev/null 2>/dev/null
if [ "$?" == "0" ]
then
    mixer ogain 100:100
fi

USER="`id -u`"

if [ "${USER}" != "0" ]
then
    is_copy_need="1"

    cd /usr/local/share/ulbsd/skel
    for i in `ls -A`
    do
        if [ -e ~/"${i}" ] ; then is_copy_need="0"; break
        fi
    done

    if [ "${is_copy_need}" == "1" ]; then
        for i in `ls -A`
        do
            cp -R "${i}" ~/
        done
    fi

    cd ~

    if [ -f /var/db/AccountsService/icons/$LOGNAME ]; then
        ln -fs /var/db/AccountsService/icons/$LOGNAME .face.icon
    fi
fi
