ip_to_hex function

This commit is contained in:
Jonas Forsberg 2020-04-23 08:06:49 +02:00
parent 8aac0b880c
commit d24140b4de
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -55,3 +55,7 @@ function copy_k8s_token(){
grep "id-token" ~/.kube/config | awk '{print $2}' | xclip -sel clip grep "id-token" ~/.kube/config | awk '{print $2}' | xclip -sel clip
} }
function ip_to_hex(){
IFS=. read oct1 oct2 oct3 oct4 <<< "$1"
printf '0x%02x%02x%02x%02x\n' $oct1 $oct2 $oct3 $oct4
}