
Chapter 7: Using the cli Utility 147
Example cli shell script
Start the script by entering #!/usr/bin/cli with the
-CF options.
You could then make the script executable and execute it on the command line, as shown in
the following example.
Example bash shell script
If you want to run a cli command from the same script that is running other Linux commands, you
could put the command in another type of shell script. The bash shell is shown in the
following example.
If you want to run multiple cli commands from a script that is also running other Linux commands,
you could add the multiple cli commands as shown in the following example.
You could then make the script executable and execute it on the command line, as shown in the
following screen example.
#!/usr/bin/cli -CF
set network interface failover yes
[root@MergePoint5224 /]# chmod 777 scriptname1
[root@MergePoint5224 /]# ./scriptname1
#!/bin/bash
...
/usr/bin/cli -CF -- set network interface failover yes
...
#!/bin/bash
...
/usr/bin/cli << EOF
set network interface failover yes
set network hostname frutabaga
commit
EOF
[root@MergePoint5224 /]# chmod 777 scriptname2
[root@MergePoint5224 /]# ./scriptname2
Komentarze do niniejszej Instrukcji