Execute root commands using connect-client script [Solved]
-
Hi,
I'm using the openvpn option client-connect to run a script when a client connects.
I tried to execute some commands that require root previliges but it's not working.Can you tell me what do I need to modify to execute the root commands in the client-connect script??
Thank you!
-
Update
Actually there was no privileges issue. The script could not execute the root commands because it couldn't recognize them.
I could fix the problem by specifying the full path to the commands. Examples:
/usr/local/sbin/bgpctl reload (using just 'bgpctl reload' inside the script wasn't working)
/sbin/route add -net $ifconfig_pool_remote_ip/30 -interface $dev -static
Now it works.
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.