#!/bin/bash
#
# clears errors in readproctitle
#
# When you want to clear the service errors, just run this:
# svc -o /service/clear
#
# Rob Mayoff, 2001-10-09 19:23:39, log@list.cr.yp.to
# http://marc.theaimsgroup.com/?l=log&m=100265849322872
# George Georgalis, 2003-02-16, george@galis.org
# Jeremy Kitchen, 2004-02-05, kitchen@scriptkitchen.com
# Jeremy Kitchen 2004-04-26, kitchen@scriptkitchen.com

cd /package/admin/
mkdir clear
touch clear/down

cat > clear/run <<EOF
#!/bin/sh
yes '' | head -4000 | tr '\n' .

# When you want to clear the service errors, just run this:
# svc -o /service/clear
EOF
chmod +x clear/run
chmod a-w clear/down

ln -s /package/admin/clear /service/.clear
mv /service/.clear /service/clear

# doh.  after reading the documentation over again
# I realized that this line was perfectly safe,
# however, I still feel it's unnecessary, but whatever :)

