|  | @@ -4,10 +4,14 @@ opt=$1
 | 
	
		
			
			| 4 | 4 |  
 | 
	
		
			
			| 5 | 5 |  path_script="$(dirname $(readlink --canonicalize-existing "$0"))"
 | 
	
		
			
			| 6 | 6 |  sudo openssl req -new -x509 -newkey rsa:2048 -keyout $pash_script/MOK.priv -outform DER -out $pash_script/MOK.der -nodes -days 36500 -subj "/CN=YOUR_NAME/"
 | 
	
		
			
			| 7 |  | -# eval scan_ls="(" $(find /lib/modules/$(uname -r) -type f -name "$opt".ko -printf '%f\n') ")";
 | 
	
		
			
			| 8 |  | -for modfile in $(find /* -type f --name $opt -printf '%f\n'); do
 | 
	
		
			
			| 9 |  | -  echo "Signing $modfile"
 | 
	
		
			
			| 10 |  | -  /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
 | 
	
		
			
			| 11 |  | -                                $path_script/MOK.priv \
 | 
	
		
			
			| 12 |  | -                                $path_script/MOK.der "$modfile"
 | 
	
		
			
			| 13 |  | -done
 | 
	
		
			
			|  | 7 | +eval mod_ls="(" $(find /lib/modules/$(uname -r) -type f -name "$opt".ko -printf '%f\n') ")";
 | 
	
		
			
			|  | 8 | +if [[ "$(echo -e ${#mod_ls[@]})" != "0' ]]; then
 | 
	
		
			
			|  | 9 | +   for ((i_md = 0; i_md != ${#mod_ls[@]}; i_md++)); do
 | 
	
		
			
			|  | 10 | +     echo "Signing ${mod_ls[$i_md]}"
 | 
	
		
			
			|  | 11 | +     /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
 | 
	
		
			
			|  | 12 | +                            $path_script/MOK.priv \
 | 
	
		
			
			|  | 13 | +                            $path_script/MOK.der "$modfile"
 | 
	
		
			
			|  | 14 | +    done
 | 
	
		
			
			|  | 15 | +else
 | 
	
		
			
			|  | 16 | +	echo "Not found module.."
 | 
	
		
			
			|  | 17 | +fi
 |