Example of a post-upgrade script, Uploading and downloading files, Upload/download menu – RuggedCom RuggedRouter RX1100 User Manual
Page 320
34. Maintaining The Router
Revision 1.14.3
320
RX1000/RX1100™
• post-upgrade will be downloaded by the router and executed immediately after the upgrade
process has completed.
The scripts must start with "#!/bin/bash" or "#!/usr/bin/perl" in order to use one of either the BASH
or PERL command interpreters on the router and be designed to produce consistent results in the
event that they are run more than once consecutively. It is possible, for example, for an upgrade to
be interrupted after the pre-upgrade script runs, and restarted at a later date.
The result of running the pre-upgrade script is included in the upgrade output.
34.13.6.1. Example Of A post-upgrade Script
The following post-upgrade script will send an email notification when an upgrade completes
(assuming SMTP 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/
echo >> /tmp/mail
cat /tmp/mail | ssmtp [email protected]
rm -f /tmp/mail
34.14. Uploading And Downloading Files
Figure 34.47. Upload/Download menu