You can use rsh (not secure) or ssh (more secure). By the way, if you use halt with the "-f" option, you do not need to disable cluster. That way, cf will get enabled automatically again after a reboot.
For rsh, you will need to setup a host that may access the filer:
options rsh.enable on
options rsh.access host=<ip-addres or hostname from which you run the script>
Then in the script, you can run the commands like this:
rsh filer1 -l root halt -t 3 -f
rsh filer2 -l root halt -t 4 -f
For SSH, setup is a bit more difficult, especially if you run the script from a windows host. A good example is in this KB article: https://kb.netapp.com/support/index?page=content&id=1011670