Hi, I'm creating virtual users with MySQL, and I don't know how to generate the hashed versions of the passwords.
input:
convert.sh:
I need to use
input:
Code:
username1 password1
username2 password2
username3 password3
convert.sh:
Code:
#!/bin/sh
INPUT=./input
OUTPUT=./output
AWK=/usr/bin/awk
$AWK '{printf("INSERT INTO `virtual_users` VALUES (NULL, '\''%s'\'', '\''%s'\'');\n", $1, $2)}' $INPUT > $OUTPUT
I need to use
$ dovecotpw -s SSHA256 -p password
to insert the hashed string into the output, but I don't know if it can be done with awk. Can anyone point me in the right direction? Thanks.