I recently obtained a Rittal CMC-TC PU II environment monitoring system. With any device, I always like to update it to the latest firmware possible and went on the hunt for firmware files for the CMC. Luckily, I found Rittal still freely provides the required files.

The update process isn’t as straightforward as just uploading a binary file to a web interface or even tftp’ing it over. Instead, the supplied instructions tell you to run a .bat file to perform the update. As I don’t run Windows, and running random scripts downloaded from the internet perhaps isn’t the greatest idea anyway, I tried figuring out what the script was doing and how to replicate it on MacOS.

Even before just looking at the commands in the .bat file, a screenshot in the update manual hinted at what was going on under the hood: CMC-TC Update instructions screenshot

The .bat file executes multiple other .bat files that open an FTP connection to the device to update. The update is divided in 3 steps where it updates various sections of the device’s (Linux-based) operating system. Between the stages it basically waits for the device to come back online before opening another FTP-session and execute the next step of the update. The commands executed in these sessions are stored in the *.295 files.

➜  Rittal_PU2_Update_v2.95.00 cat update.295
admin
admin
hash
binary
cd download
put linux
cd ..
cd upload
delete *
delete *.*
put update295.00.1.tgz
put update295.00.2.tgz
put update.sh
put update
quit

Note that the two ‘admin’ lines are the default username and password respectively.

In the end, I manually opened an FTP-session, executed the commands from the update0.295 file, waited for the device to come back, opened another FTP session and ran the commands from the update.295 file. I also ran the commands in the update_l.295 file, but going by the device logs this update was not actually required when coming from the firmware version I was on.