ungleich-learning-circle/pedro/ipv6-stuff/overlap_run.sh
2020-07-22 16:34:31 +02:00

32 lines
648 B
Bash
Executable file

#!/bin/sh
run_program() {
echo "args:\n ip1: ${1}\n ip2: ${2}"
printf 'output: '
python3 overlap.py ${1} ${2}
echo "exit code: $?"
echo '----------------'
}
# - Use the following test IPv6 addresses:
# - 2001:db8::
# - 2001:db8:0:2::
# - 2001:db8:1::
# - Step 2: Make your script parse ipv6 networks (like
# 2001:db8::/48 and 2001:db8::/64) ) and check whether they overlap
ip1='2001:db8::'
ip2='2001:db8:0:2::'
run_program $ip1 $ip2
ip1='2001:db8::'
ip2='2001:db8:1::'
run_program $ip1 $ip2
ip1='2001:db8:0:2::'
ip2='2001:db8:1::'
run_program $ip1 $ip2
ip1='2001:db8::/48'
ip2='2001:db8::/64'
run_program $ip1 $ip2