set_worker_password.sh 282 B

123456789101112
  1. #!/bin/bash
  2. password_file='/etc/rspamd/override.d/worker-controller-password.inc'
  3. password_hash=`/usr/bin/rspamadm pw -e -p $1`
  4. echo 'enable_password = "'$password_hash'";' > $password_file
  5. if grep -q "$password_hash" "$password_file"; then
  6. echo "OK"
  7. else
  8. echo "ERROR"
  9. fi