DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

unixdude's picture

Unregistered

Feeds

aliases

  • unixdude

unixdude

4 years ago

in creating a solaris 8 flash archive boot disk | Solaris system administration | Tech-Recipes on Tech-Recipes
Hi.

Just a comment on this otherwise nice script. The delete lines such as:

# remove the packages from the Product directory
cd /opt/make_os/solaris_8/s0/Solaris_8/Product
rm -rf *

and

# remove the configuration files from the .install_config directory
cd /opt/make_os/solaris_8/s0/.install_config
rm *

are extremely dangerous. If for some reason the cd command fails (permission problems, missing directories etc), the next command will wipe the rootdisk clean (or at least every file in the directory the command is issued from and all directories below). A much better version would be to do the rm command directly on the directory:

rm -rf /opt/make_os/solaris_8/s0/Solaris_8/Product/*

In this case the rm command will fail if the directory doesn't exist, and no harm would be done. Another approach would be to test for the existence of the directory prior to issue the commands, and to exit with an error code if the check fails.


Just my 0.02$ :)
Returning? Login