Skip to content
New issue

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

MD5 command in example poap file #21

Open
ryantischer opened this issue Dec 29, 2015 · 5 comments
Open

MD5 command in example poap file #21

ryantischer opened this issue Dec 29, 2015 · 5 comments

Comments

@ryantischer
Copy link

The command to recalculate the md5 is wrong. The result needs to be in double quotes. Command in question.
f=poap.py ; cat $f | sed '/^#md5sum/d' > $f.md5 ; sed -i "s/^#md5sum=./#md5sum=$(md5sum $f.md5 | sed 's/ .//')/" $f

Correct command

f=poap.py ; cat $f | sed '/^#md5sum/d' > $f.md5 ; sed -i "s/^#md5sum=./#md5sum="$(md5sum $f.md5 | sed 's/ .//')"/" $f

@wrgeorge1983
Copy link

Can confirm this is correct for 9372PX.

@ma-hack
Copy link

ma-hack commented Feb 23, 2016

Yes, the command doesn't work on OSX or Ubuntu. I tried your command but after the md5sum appears the filename... for example:
#md5sum="daff7e4f7617d257b66de61504120fe9n6000_poap_script.7.2.1.N1.1.py.md5"243

Have anyone a fix for that?

@wrgeorge1983
Copy link

Just confirmed @ma-hack on an ubuntu server. When I get back into work I'll grab the string I used.

@wrgeorge1983
Copy link

Here is what's been working for us:

# or like this on nexus 9k series switches that demand double quotes around the md5sum:
# f=poap.py ; cat $f | sed '/^#md5sum/d' > $f.md5 ; sed -i "s/^#md5sum=.*/#md5sum=\"$(md5sum $f.md5 | sed 's/ .*//')\"/" $f

looks like the main difference is changing a few instances of ./ into .*/, but I'm not a sed guy

@ma-hack
Copy link

ma-hack commented Feb 29, 2016

Great it works! Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants