CustomizationThis is a featured page

Currently the ISO image that is created by Repository Manager prompts the user for the input of which bundle to deploy. If you are automating an installation, as we did in the demo on the previous page, you'll want to suppress this prompting so the DUPs will apply without user intervention.

Default Location of apply_bundles.sh and Default Action


Chosing the "Deployment Media (Linux only) Export to ISO" option causes Repository Manager to build a custom ISO image and deploy the updates using the "apply_bundles.sh" script. For a default installation, the script is located here :

C:\Program Files\Dell\Dell Repository Manager\isocreation\isolinux\drm_files\

This section of the script reads the directories created from the bundles you selected while creating the ISO in Repository Manager and creates an array of those directories :

find ./* -type d > "$PAYLOAD_DIR"tempDirList.tmp

while read file;
do
echo `expr $DIR_ARRAY_LENGTH + 1`". ""${file:2}"
DIR_ARRAY[${#DIR_ARRAY[*]}]="${file:2}"
DIR_ARRAY_LENGTH="${#DIR_ARRAY[*]}"
done < "$PAYLOAD_DIR"tempDirList.tmp


for i in ${!DIR_ARRAY[*]}
do
VALID_INPUT_ARRAY[i]=`expr $i + 1`
done

The script then reads through this array and prompts the user for the bundle to apply using the $SELECTION_INDEX variable :

while [ "$SELECTION_INDEX" -lt 0 ] || [ "$SELECTION_INDEX" -gt "$MAX_VALID_INDEX" ] do

echo ""
echo "Input the number corresponding to the bundle you would like to apply to this system followed by <ENTER>"
read SELECTION_INDEX

The updates are then applied with this portion of the script and any error codes are output to the screen :

cd "$SCRIPT_DIR""${DIR_ARRAY[SELECTION_INDEX]}"
for i in `ls *.sh`
do

echo "executing script $i"
ERROR_STRING=`"./${i}"`

if [ "$?" != 0 ]
then

echo "$ERROR_STRING"
STATUS=1
break

fi

done

Changes to Script for Autoexecution and Reboot


When using this method to deploy updates across multiple machines, it would be helpful if the script autoexecuted and rebooted if the updates were successful. Making the following changes to the apply_bundles.sh script accomplishes those two tasks.

First, change the section in the script so that it simply sets the $SELECTION_INDEX instead of prompting :

while [ "$SELECTION_INDEX" -lt 0 ] || [ "$SELECTION_INDEX" -gt "$MAX_VALID_INDEX" ] do

echo ""
echo "Input the number corresponding to the bundle you would like to apply to this system followed by <ENTER>"
# read SELECTION_INDEX
SELECTION_INDEX=1

Secondly, after the execution of all the updates we check the $STATUS code and if returns 0, then reboot :

if [ "$STATUS" == 0 ]
then
echo "AUTOREBOOT by SCOTT"
sleep 30
reboot
else
echo "Check /bundleapplicationlogs for ERRORS"
fi

Add this section of code at the end of the script.


No user avatar
TDA-James
Latest page update: made by TDA-James , Nov 5 2009, 7:27 PM EST (about this update About This Update TDA-James Edited by TDA-James

1 word added
1 word deleted

view changes

- complete history)
Keyword tags: repository manager dups
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.