0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【TTL】Fortigateインターネット接続確認

Posted at

Fortigateが8.8.8.8へ疎通が取れることを確認します。疎通ができない場合は、再起動をします。

; コマンドオプション組立て
connect "192.168.4.254:22 /ssh /auth=password /user=admin /passwd=Zaq12wsx"

;8.8.8.8への疎通確認
wait 'Home-Fortigate'
sendln 'execute ping 8.8.8.8'

wait 'from 8.8.8' 'sendto failed'

; "from 8.8.8" が来たなら、:end
If result=1 goto end

;"sendto failed" が来ない場合、タイムアウトで:reboot へジャンプ。
if result=2 goto reboot

endif

:reboot
wait 'Home-Fortigate'
sendln 'execute reboot'
wait '(y/n)'
sendln 'y'

:end
wait 'Home-Fortigate'
sendln 'exit'

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?