#!/bin/sh
# cleans the /var/run/athena-sessions directory

# . /lib/init/vars.sh
# . /lib/lsb/init-functions

# report_err()
# {
#     if [ "$VERBOSE" = no ]
# 	then
# 	log_failure_msg "bootclean: Failure cleaning /var/run/athena-sessions."
#     else
# 	log_action_end_msg 1 "bootclean: Failure cleaning /var/run/athena-sessions."
#     fi
# }

report_err()
{
    :;
}

case "$1" in
start)
    cd /var/run/athena-sessions/ || { report_err ; exit 1 ; }
    # First remove all old files.
    find . -depth -xdev ! -type d -print0 | xargs -0r rm -f -- || { report_err ; exit 1 ; }
    # And then all empty directories.
    find . -depth -xdev -type d ! -name . -empty -exec rmdir \{\} \; || { report_err ; exit 1 ; }
    ;;
restart|stop|force-reload)
    ;;
esac

exit 0
