diff --git a/.functions.sh b/.functions.sh index 5b9b1e6..afab2dc 100644 --- a/.functions.sh +++ b/.functions.sh @@ -55,3 +55,7 @@ function copy_k8s_token(){ 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 +}