Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Execute root commands using connect-client script [Solved]

    Scheduled Pinned Locked Moved OpenVPN
    2 Posts 1 Posters 642 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hatimux
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • H
        hatimux
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.