We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
thanks a lot for this great script. I had a small issue:
START_ALIAS_LINUX="10.2.237.1"; END_ALIAS_LINUX="10.2.237.49"
This stopped the script working beyond IP 10.2.237.10 because: last_ip_used outputs 10.2.237.9 where it should output 10.2.237.10:
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -u|tail -1 10.2.237.9
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -u 10.2.237.10 10.2.237.2 10.2.237.3 10.2.237.4 10.2.237.5 10.2.237.6 10.2.237.7 10.2.237.8 10.2.237.9
Adding the -n switch to the sort command fixes this:
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -un|tail -1 10.2.237.10
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
thanks a lot for this great script.
I had a small issue:
START_ALIAS_LINUX="10.2.237.1";
END_ALIAS_LINUX="10.2.237.49"
This stopped the script working beyond IP 10.2.237.10 because: last_ip_used outputs 10.2.237.9 where it should output 10.2.237.10:
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -u|tail -1
10.2.237.9
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -u
10.2.237.10
10.2.237.2
10.2.237.3
10.2.237.4
10.2.237.5
10.2.237.6
10.2.237.7
10.2.237.8
10.2.237.9
Adding the -n switch to the sort command fixes this:
docker inspect --format '{{ .HostConfig }}' $(docker ps -aq)| grep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ 8000'|cut -d" " -f 1|sort -un|tail -1
10.2.237.10
The text was updated successfully, but these errors were encountered: