#!/bin/sh

# Shall the \a be removed from the written data
if [ -z "$SB_REMOVE_BEL" ]; then
	SB_REMOVE_BEL=yes
	export SB_REMOVE_BEL
fi

# What program shall be run
if [ -z "$SB_RUN" ]; then
	SB_RUN="sb-beep"
	export SB_RUN
fi

# Enable the preloading
LD_PRELOAD="$LD_PRELOAD /usr/lib/softbeep/libsoftbeep.so"
export LD_PRELOAD

# Run the program
if [ $# != 0 ] ; then 
	exec "$@"
else
	echo "Spawning subshell."
	exec $SHELL
fi
