Software /
code /
prosody-modules
File
mod_auth_external/authorize_example.sh @ 243:6202ce4d12d6
mod_archive: added some config options.
mod_archive_muc: added some config options.
author | shinysky<shinysky1986(AT)gmail.com> |
---|---|
date | Fri, 13 Aug 2010 20:21:39 +0800 |
parent | 197:2686221255cf |
line wrap: on
line source
#!/bin/bash IFS=":" AUTH_OK=1 AUTH_FAILED=0 LOGFILE="/var/log/prosody/auth.log" USELOG=true while read ACTION USER HOST PASS ; do [ $USELOG == true ] && { echo "Date: $(date) Action: $ACTION User: $USER Host: $HOST Pass: $PASS" >> $LOGFILE; } case $ACTION in "auth") if [ $USER == "someone" ] ; then echo $AUTH_OK else echo $AUTH_FAILED fi ;; *) echo $AUTH_FAILED ;; esac done