Skip to main content

Thread: How to test if a host "exists" (host anmed resolvable) from a script?


i check if network host "exists" (i happy if address can resolved)from script dont know how

use in order check if proxy server exists , in case set "system wide" proxy (perhaps need update or perhaps switch between 2 different apt config files or apt , package manager obey proxy environment variables?)

/javafanboy

you can check if network host resolvable, , set environment variable accordingly using following script:

code:
proxy=`ping -w 1 -c 1 192.168.1.1 | grep '1 received'`  if [ -n "$proxy" ];    export http_proxy=http://192.168.1.1:8080    export ftp_proxy=http://192.168.1.1:8080 fi
apt obey proxy environment variables, above code should work. change ip address , port proxy settings.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [ubuntu] How to test if a host "exists" (host anmed resolvable) from a script?


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account