Friday, June 14, 2013

MX-ONE scripts

Using text files to install an MX-ONE appears to be more complicated than the old MD110 method. However, it can be achieved in the following way. Consider the example below:

#!/bin/bash
license_status -s > /home/user/license.txt

If the above were in a file called lic_export.sh, it could be run sh  lic_export.sh or ./lic_export.sh

That is "linux style" commands, and are thus pretty straightforward. How about MML commands, i.e. commands that require the MDSH (MD Shell)?

Create two files. File1.sh and File2.mx1 (File2 can be .mx1, txt, whatever you want)

File1.sh:

#!/bin/bash
mdsh File2.sh
----------------------------------------------
File2.sh:

roeqi:rou=1,tru=1-1&&1-15,equ=1a-0-10-01;
rodai:dest=0,rou=1;

Running the command sh File1.sh or ./File1.sh will actually run both File1.sh and File2.sh, but File2.sh will be run in the MD shell!

Since you don't want a large file to run out of control, the following can be added to provide some control:

read -n1 -p "Press Enter to continue."

At this point you either press Enter or Ctrl-C if things seem wrong.

Normal bash scripts can be used to provide if statements and while loops so that an entire menu can be presented with choices and exit options.