Skip to content

Instantly share code, notes, and snippets.

@ytez
Created March 11, 2022 02:59
Show Gist options
  • Save ytez/4f9fd33555fc7daab1fbb0e21edffd5d to your computer and use it in GitHub Desktop.
Save ytez/4f9fd33555fc7daab1fbb0e21edffd5d to your computer and use it in GitHub Desktop.
[TeraTerm マクロ] FortiGate execute shutdown
IPADDR = '169.254.0.1'
SSHPORT = '22'
USER = 'user'
PASSWD = 'password'
WAITPASSWD = '^.*[Pp]assword: ?'
WAITPROMPT = '^.*# '
;#--- ssh login
sprintf2 _SSH_ARGS '%s:%s /ssh /2 /auth=password /user="%s" /passwd="%s"' IPADDR SSHPORT USER PASSWD
waitregex WAITPROMPT
;#--- execute command
sendln 'execute shutdown'
; Do you want to continue? (y/n)y
; System is shutting down...
; The system is going down NOW !!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment