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:
apt obey proxy environment variables, above code should work. change ip address , port proxy settings.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
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
Post a Comment