Skip to content

Instantly share code, notes, and snippets.

@weirdbricks
Created May 7, 2014 22:36
Show Gist options
  • Save weirdbricks/f86c14c53c35c8f7930f to your computer and use it in GitHub Desktop.
Save weirdbricks/f86c14c53c35c8f7930f to your computer and use it in GitHub Desktop.
beep.sh
#!/usr/bin/env sh
#checks if the speaker module is loaded - if not it loads it and makes a be
#based on http://forums.freebsd.org/viewtopic.php?t=12001
module=`kldstat | grep speaker -c`
if [ $module -eq 0 ]
then
echo "speaker module not found - adding"
kldload speaker
fi
#now beep!
echo "BP" > /dev/speaker
echo "SO4L16G>L8C." > /dev/speaker
echo "BP" > /dev/speaker
echo "SO4L16G>L8C." > /dev/speaker
#and make a notice to dmesg
logger -p kern.crit COMPLETE!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment