#!/bin/sh # WARNING: REQUIRES /bin/sh # # - must run on /bin/sh on solaris 9 # - must run on /bin/sh on AIX 6.x # - if you think you are a bash wizard, you probably do not understand # this programming language. do not touch. # - if you are under 40, get peer review from your elders. INSTALLER_DIR=/opt/chef if [ -e $INSTALLER_DIR ]; then echo "removing $INSTALLER_DIR..." # have to do this dance of moving /opt/chef to a tmp dir since files may be in use tmp_dir="/opt/.chef.$$" # if we can't create the tmp_dir then fail hard to prevent any possible security hole (umask 077 && mkdir $tmp_dir) || exit 1 # now we can clean up the tmp_dir we created safely mv $INSTALLER_DIR $tmp_dir # ignore errors which must be EBUSY issues, this may crate some litter, which may # be unavoidable rm -rf $tmp_dir || true fi