mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-08 05:04:46 +08:00
update 2026-05-10 09:48:30
This commit is contained in:
1 parent
95ac96413e
commit
0b362674f1
6244 files changed
+2992248
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIG="luci-app-openvpn-server"
|
||||
OVPN_PATH=/var/etc/openvpn-server
|
||||
LOG_FILE=${OVPN_PATH}/client.log
|
||||
AUTH_FILE=${OVPN_PATH}/auth
|
||||
TIME="$(date "+%Y-%m-%d %H:%M:%S")"
|
||||
|
||||
IP=${untrusted_ip}
|
||||
|
||||
CORRECT_PASSWORD=$(awk '!/^;/&&!/^#/&&$1=="'${username}'"{print $2;exit}' ${AUTH_FILE})
|
||||
if [ "${CORRECT_PASSWORD}" = "" ]; then
|
||||
echo "${TIME}: ${username}/${IP} Fail authentication. input password=\"${password}\"." >> ${LOG_FILE}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${password}" = "${CORRECT_PASSWORD}" ]; then
|
||||
echo "${TIME}: ${username}/${IP} Successful authentication." >> ${LOG_FILE}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "${TIME}: ${username}/${IP} Fail authentication. input password=\"${password}\"." >> ${LOG_FILE}
|
||||
exit 1
|
||||
Reference in new issue
Block a user