connect-script = /app/connect.sh
disconnect-script = /app/disconnect.sh我在停靠容器中的ocserv.conf中有上面的配置,但是ocserv在有连接时无法执行ocserv.conf。我无法从下面的日志中找到真正的原因,有谁有过同样的问题吗?
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}"发布于 2021-06-27 02:26:38
嗯,我自己发现我创建的坞容器没有bash,一个解决方案是用#!/bin/bash替换#!/bin/sh。
https://stackoverflow.com/questions/68144058
复制相似问题