Mercurial > prosody-modules
comparison mod_auth_external_insecure/examples/bash/prosody-auth-example.sh @ 3884:f84ede3e9e3b
mod_auth_external->mod_auth_external_insecure: Unmaintained and almost certainly insecure, discourage its use
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 06 Feb 2020 21:03:17 +0000 |
parents | mod_auth_external/examples/bash/prosody-auth-example.sh@25641c4cab36 |
children |
comparison
equal
deleted
inserted
replaced
3883:571249f69577 | 3884:f84ede3e9e3b |
---|---|
1 #!/bin/bash | |
2 | |
3 IFS=":" | |
4 AUTH_OK=1 | |
5 AUTH_FAILED=0 | |
6 LOGFILE="/var/log/prosody/auth.log" | |
7 USELOG=false | |
8 | |
9 while read ACTION USER HOST PASS ; do | |
10 | |
11 [ $USELOG == true ] && { echo "Date: $(date) Action: $ACTION User: $USER Host: $HOST Pass: $PASS" >> $LOGFILE; } | |
12 | |
13 case $ACTION in | |
14 "auth") | |
15 if [ $USER == "someone" ] ; then | |
16 echo $AUTH_OK | |
17 else | |
18 echo $AUTH_FAILED | |
19 fi | |
20 ;; | |
21 *) | |
22 echo $AUTH_FAILED | |
23 ;; | |
24 esac | |
25 | |
26 done |