Jump to content

Translate fqdn to ip batch variable.


sudoinit6

Recommended Posts

Not sure if this qualifies as a snippet, but it is something that I have had to work around for awhile now, and I just figured out a solution so I thought I would share in hopes that it helps someone else.

 

I bounce my proxies every day and use a dynamic dns service to give them a fqdn (fully qualified domain name). This made automating the creation of new batch files to launch bots a bit tricky as the ip of the proxy would be different every day, now it's a breeze. This is the batch file for the launch of the bot:

for /f "tokens=1,2 delims=[]" %%A in ('ping proxyname.host.com ^| find "Pinging"') do set ipaddress=%%B
java -jar "osbot 2.4.67.jar" -login alek:password -bot alek@osbot.com:password:1234 -debug 5005 -script test:param1 -proxy %ipaddress%:1080:proxusername:proxpassword

 

The variable %ipaddress% will be set to the fqnd that was pinged in the first command.

 

Probably not useful to many but there it is.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...