This script worked for me once I enabled SSH on the lan interface on my FortiGate 100D running 5.0.  But the only command that seemed to do anything is &quot;exit&quot;.  Everything else gave an &quot;Unknown Action 0&quot;.