Jump to content

Translate fqdn to ip batch variable.


Recommended Posts

Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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