iw4p / OpenConnect-Cisco-AnyConnect-VPN-Server-OneKey-ocserv

[Script and Docker 🐳] OpenConnect (Cisco AnyConnect) VPN Server (OCServ) script one key easy configurator and installer
246 stars 131 forks source link

Is there anyway wo create user with php or API #49

Open elegance666 opened 10 months ago

elegance666 commented 10 months ago

shell_exec("docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd testUserName"); is working but it needs password in second step is there anyway to add new user by one command?

iw4p commented 10 months ago

echo password and pipe it. Does not test the bellow command but might work with some changes. docker exec -ti ocserv ocpasswd -c echo 'password' | /etc/ocserv/ocpasswd testUserName