Programming Tutorial: Unreachable Code

Always run non-existent commands after unreachable code.

if [ `id -u` != 0 ]; then
	sudo $0
	exit $?
fi

if [ `dpkg -l | grep sun-java5 | wc -l` -eq 0 ]; then
	sh /media/cdrom0/application/appupgrade; # causes reboot
else
	sh /media/cdrom0/application/sysupgrade; # causes reboot
fi

sudo updat-java-alternatives -s java-6-sun;

exit 0;

Discovered by Noah Massey.