Installing a new package, Pre-upgrade/post-upgrade scripts – RuggedCom RuggedRouter RX1000 User Manual

Page 265

Advertising
background image

Chapter 26 – Maintaining The Router

Installing A New Package

Figure 237: Installing A New Package

The Install A New Packages feature uploads and installs packages to the router.
Select the From local file option if you have already moved the package to the router
through http, ftp or scp. You may either enter the full path from the root directory to
the package or use the file selector (

) to identify the package.

Select the From uploaded file option if you have the file locally on your
workstation. You may either enter the location of the file on your local file system
browse selector (

) to identify the package.

Select the From ftp or http URL if you know the network address of the package.
Complete the installation by selecting the install button.

Pre-upgrade/Post-upgrade scripts

The pre-upgrade and post-upgrade script feature allows you to execute a user defined
script before and after a software system upgrade.
The scripts run only when there are packages to install, they will not run when
“showing” packages that could be installed.
During a real upgrade, the router will try and download the scripts from the same
location as is configured by the Change Repository Server page. The router will
attempt to download a file named “pre-upgrade” and execute it before the upgrade
starts. After the upgrade completes (including webmin) the router will attempt to
download a file named “post-upgrade” and execute it.
The scripts start with #!/bin/bash or #!/usr/bin/perl and be designed to produce
consistent results in the event they are subsequent run a second time. It is possible
that the upgrade can be interrupted after the preupgrade script runs, and re-started at a
later date.
The result of running the pre-upgrade script is included in the upgrade output. If ran
through the automatic upgrade, the scripts output can be viewed by through the
“View Log File of Last Upgrade” button on the Software Upgrade System page.

Example of a post-upgrade script: The following post-upgrade script will send an
email notification when upgrade completes (assuming ssmtp is configured properly).

#!/bin/bash
echo "Subject: Software upgrade for Release rr1.9.0 on `hostname` completed" > /tmp/mail
echo "To: [email protected]" >> /tmp/mail 
echo "Software upgrade for Release rr1.9.0 on `hostname` completed at `date`" >> /tmp/mail 
echo >> /tmp/mail 
cat /tmp/mail | ssmtp [email protected] 
rm ­f /tmp/mail

RuggedCom 263

Advertising