# # Now we'll write the template file # cat > /etc/default/explorer << EOT Customer Name: $CUSTOMER Contract ID: $CONTRACT Email results to: $EMAILTO User Name: $USERNAME User e-mail: $UEMAIL User Phone #: $PHONE System Serial number: $SERIAL Customer ID: $CUSTID Address line 1: $ADDR1 Address line 2: $ADDR2 City: $CITY State: $STATE Country: $COUNTRY Zip Code: $ZIP EOT # # Now we'll run the explorer # [ $RUNNOW = "Y" ] && { echo "\nRunning Sun Explorer. This may take some time....." cd $BASEDIR/$PKG if [ ! -z "${EMAILTO}" ] then ./explorer -myemail ${EMAILTO} echo "Emailed results to ${EMAILTO}." else ./explorer echo "Results are in ${BASEDIR}/${PKG}." fi } # # Now we'll setup the crontab for root if customer allows # ROOT_CRONTAB=/var/spool/cron/crontabs/root if [ $MODCRON = "Y" ]; then # Escape / in path PAT=`echo "$BASEDIR/$PKG/explorer" | sed 's!\/!\\\/!g'` # delete any existing root cron entry crontab -l | sed -e "/$PAT/d" > /tmp/$$cron # Added explorer to crontab echo "${CMINUTE} ${CHOUR} * * ${CDAY} $BASEDIR/$PKG/explorer -mail" >> /tmp/$$cron crontab /tmp/$$cron rm -f /tmp/$$cron echo "\nRoot crontab has been updated." fi