ocserv 无法为传入连接执行脚本
ocserv could not execute script for the incoming connection
connect-script = /app/connect.sh
disconnect-script = /app/disconnect.sh
我的ocserv.conf在docker容器里有上面的配置,但是ocserv执行失败[=21= .sh 当有连接时。我从下面的日志中找不到真正的原因,有没有人有同样的问题?
ocserv[26]: main[test]:xxx.xxx.179.135:57352 user of group 'Route' authenticated (using cookie)
ocserv[29]: main[test]:xxx.xxx.179.135:57352 executing script up /app/connect.sh
ocserv[29]: main[test]:xxx.xxx.179.135:57352 main-user.c:379: Could not execute script /app/connect.sh
ocserv[26]: main[test]:xxx.xxx.179.135:57352 connect-script exit status: 1
ocserv[26]: main[test]:xxx.xxx.179.135:57352 failed authentication attempt for user 'test'
/app/connect.sh的内容:
#!/bin/bash
echo "$(date) [info] User ${USERNAME} Connected - Server: ${IP_REAL_LOCAL} VPN IP: ${IP_REMOTE} Remote IP: ${IP_REAL} Device:${DEVICE}"
嗯,我自己想通了,我创建的 docker 容器没有 bash,一种解决方案是用 #!/bin/sh
替换 #!/bin/bash
。
connect-script = /app/connect.sh
disconnect-script = /app/disconnect.sh
我的ocserv.conf在docker容器里有上面的配置,但是ocserv执行失败[=21= .sh 当有连接时。我从下面的日志中找不到真正的原因,有没有人有同样的问题?
ocserv[26]: main[test]:xxx.xxx.179.135:57352 user of group 'Route' authenticated (using cookie)
ocserv[29]: main[test]:xxx.xxx.179.135:57352 executing script up /app/connect.sh
ocserv[29]: main[test]:xxx.xxx.179.135:57352 main-user.c:379: Could not execute script /app/connect.sh
ocserv[26]: main[test]:xxx.xxx.179.135:57352 connect-script exit status: 1
ocserv[26]: main[test]:xxx.xxx.179.135:57352 failed authentication attempt for user 'test'
/app/connect.sh的内容:
#!/bin/bash
echo "$(date) [info] User ${USERNAME} Connected - Server: ${IP_REAL_LOCAL} VPN IP: ${IP_REMOTE} Remote IP: ${IP_REAL} Device:${DEVICE}"
嗯,我自己想通了,我创建的 docker 容器没有 bash,一种解决方案是用 #!/bin/sh
替换 #!/bin/bash
。