SSH の Match Exec で接続元の環境が異なっても同じホスト名を使いたい - mattintosh note
と似たことを、Webブラウザでやりたいわけです
ssh_config で言うところの
Match Host alp10 Exec "ping -c1 -W1 192.168.33.10"
HostName 192.168.33.10
Match Host alp10 Exec "ping -c1 -W1 129.60.149.232"
HostName 129.60.149.232
Port 22010
みたいな感じで、こういうことをしたい
もし "ping 192.168.33.20" が成功するならば
ブラウザで http://192.168.33.20/ を開け
もし "ping 192.168.33.22" が成功するならば
ブラウザで http://192.168.33.22:8081/ を開け
switch_url.bat
ping -n 1 -w 100 192.168.33.20
if errorlevel 1 goto ip22
start msedge "http://192.168.33.20/"
exit /b
:ip22
ping -n 1 -w 100 192.168.33.22
if errorlevel 1 goto quit
start msedge "http://192.168.33.22:8081/"
exit /b
:quit