#!/bin/bash -x
# Part of the xs-sync package
# Author: Martin Langhoff <martin@laptop.org>
# Copyright: One Laptop per Child

set -e

VERBOSE=no

# Log a string via the syslog facility.
log()
{
    if test $1 != debug || expr "$VERBOSE" : "[yY]" > /dev/null; then
	logger -p user.$1 -t "xs-usbmount[$$]" -- "$2"
    fi
}
log notice 'XS found a USB disk and mounted it - checking for new software and content to install...';

# Fibonacci console beep
hz1=50
hz2=50
while (($hz1 < 16000)); do 
    echo -en '\033[10;'$hz1']\033[11;60]\007' > /dev/console
    sleep 0.1
    hz3=$hz1
    hz1=$(($hz1 + $hz2))
    hz2=$hz3
done

#reset beep
echo -en '\033[10]\033[11]' > /dev/console
