Wednesday, April 15, 2009

Having Fun With Other Solaris Sys Admins

Hey There,

Today I'm speeding around, working my arse off so that I can work all weekend (When does it end? ...oh yeah; with the worms ;) and I wrote this little shell script (in Solaris' /bin/sh) to lighten the mood a little.

It's another in a string of a thousand fake error messages, but it worked pretty well for my purposes. I made sure to install it up front in the /etc/rc2.d directory (from JumpStart) so that any admin watching a new installation come up for the first time (to verify its integrity) would be guaranteed to see it. Man, it was fun until I had to fix the problem and pretend I had no idea what happened ;)

Enjoy the video of the script output and, hopefully, you can have some fun with this shell script (or a variation of it) on your own!

Please note that the only fun thing other than the error message are the traps set on the interrupts. It's a reboot-a-thon in the making ;)








Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

#!/bin/sh

#
# bad_news.sh - OMFG
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

trap 'tput rc' 0 1 2 3 15
echo
echo "EXCEPTION: kern.alert !!!"
echo "SYSTEM BOOT ERROR!"
sleep 1
echo "SYSTEM BOOT ERROR!"
echo "Resampling Solaris Boot Loader ..."
sleep 2
echo "Extracting libC boot loader kernel modules"
sleep 1
echo
echo "Fixing /usr/platform/"`uname -i`
echo "This should just take a moment before resuming..."
echo
echo "YOU WILL NEED TO REBOOT THE SYSTEM WHEN THIS PROCESS COMPLETES!"
sleep 1
echo
echo "RUN PHASE 1: Removing files from /usr/platform/"`uname -i`"/ ...\c"
tput sc
while :
do
echo "| \c"
tput rc
echo "/ \c"
tput rc
echo "- \c"
tput rc
echo "\\ \c"
tput rc
done


Cheers,



Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.