Skip to content

Instantly share code, notes, and snippets.

@mrngm
Created November 15, 2019 16:31
Show Gist options
  • Save mrngm/2a003f11dc9a4a395a492bd249816ec4 to your computer and use it in GitHub Desktop.
Save mrngm/2a003f11dc9a4a395a492bd249816ec4 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
echo -n 'DNS'
NSTREINIP=`ip netns exec physical host www.nstrein.ns.nl | awk '/has address/ { print $4; }'`
echo -n '. curl'
REQ=`ip netns exec physical curl -sSH 'Host: www.nstrein.ns.nl' "http://${NSTREINIP}/?action=nstrein:main.internet"`
echo '.'
echo "${REQ}" | awk '/verbonden met het internet/' | cut -d '>' -f2 | cut -d '<' -f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment