![](/images/new-backgrounds/1312008/312008269x1.webp)
Intel® NetStructureTMZT 7102 Chassis Management Module
Updating Software
Note: In prior versions of this document, the following examples showed how to use the user scripts to replace a script in the /etc/scripts directory. Going forward, all user scripts should be stored in /home/scripts. The directory /etc/scripts will be a link to /home/scripts. As a general rule, users should only put scripts and files under the /home directory.
25.12.3Example Task - Replace /home/scripts/myScript with a newer version if updating forward or an older version if updating backward
Example update scenario:
•There are three CMM builds - call them A, B, and C. The CMM is currently installed with build B. Build A is older than B and C is newer.
•If the CMM is updated to build C, then the user script /home/scripts/myScript needs to be updated to a newer version.
•Similarly, if the CMM is reverted to build A, then the user script /home/scripts/myScript needs to be replaced with an older version.
•The old version of myScript is placed on the CMM as: /home/stagingarea/myScript.old
•The new version of myScript is placed on the CMM as: /home/stagingarea/myScript.new
•The Data Restore User Script written to manage /home/scripts/myScript is placed on the CMM as: /home/update/scripts/S10updateMyScript
A simple example of the S10updateMyScript could look like the following:
#!/bin/bash
direction=$2
if [ "$direction" = "forward" ] ; then
cp /home/stagingarea/myScript.new /home/scripts/myScript elif [ "$direction" = "backward" ] ; then
cp /home/stagingarea/myScript.old /home/scripts/myScript fi
exit $?
When the update process executes, and the Data Restore User Scripts are executed (during the update of the /etc partition), then the script S10updateMyScript will be executed and /home/script/myScript will be updated accordingly.
Variation on the above example:
•In this case, the different versions of myScript are put on the CMM (by the user) as:
—/home/stagingarea/myScript.A
—/home/stagingarea/myScript.B
—/home/stagingarea/myScript.C
Note: If the CMM has build A installed, the "cmmget
Another example of S10updateMyScript:
#!/bin/bash
Technical Product Specification | 135 |