HELP: unlock/lock dataset from bash script

I solved my problem with the help of @winnielinnie (Unlock dataset via SSH - #5 by lurgainn) and this web page:
Unlocking ZFS datasets on TrueNAS Scale with midclt

I write it only because maybe it will be able to serve someone else

Cheers