create a samba-pass-backend from sql-table

echo 'select uid,login,plainpass from accounts' | psql -U peter accounts | perl -ne 'if (/^\s+(\d+)\s+\|\s+(\S+)\s+\|\s+(\S+)/) {$rid=1000+2*$1; print "(echo $3 && echo $3) | pdbedit -a -t -U $rid $2\n"}'
 
knowwiki/shorties/sql_to_smbpasswd.txt · Last modified: 2008/06/23 23:51 by peter