mirror of
				https://github.com/flatcar/scripts.git
				synced 2025-11-04 10:11:24 +01:00 
			
		
		
		
	It's not a shell script. It never was a shell script. Must have been a mistake to name it as such.
		
			
				
	
	
		
			14 lines
		
	
	
		
			328 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			328 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/python3
 | 
						|
 | 
						|
import hashlib
 | 
						|
import json
 | 
						|
import os
 | 
						|
import sys
 | 
						|
 | 
						|
path=sys.argv[1]
 | 
						|
version=sys.argv[2]
 | 
						|
 | 
						|
with open(path, "rb") as f:
 | 
						|
    kernel = f.read()
 | 
						|
    print(json.dumps({"9": {"binaryvalues": [{"prefix": "grub_linux", "values": [{"value": hashlib.sha1(kernel).hexdigest(), "description": "flatcar-%s" % version}]}]}}))
 |