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

    Shell script to activate OpenVPN

    Scheduled Pinned Locked Moved OpenVPN
    3 Posts 2 Posters 567 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.
    • A
      alivdel
      last edited by

      hello all,

      i wrote a small Shell script to activate and deactivate OpenVpn through IO Device. In my script i have while Loop which looks every 2 Sec the Output of my IO device to activate or deactivate OpenVpn.
      It works very good if i execute it manually, but i want to start it by Startup automatically. So i put my script in "/usr/local/etc/rc.d" which will be executed on Startup. But Problem is, it dont work properly correct compare to when i execute it manually. Usually after 3 times activate and deactivating OpenVpn it dosnt work anymore.

      Anybody knows what the Problem can be?
      thanks.

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        why would you want/need to do such a thing?  Openvpn server or client if enabled would autostart by default.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • A
          alivdel
          last edited by

          thanks for reply,
          but that's what we need to do, we want to activate or deactivate our VPN Client anytime just by pressing a Switch.
          but ist not my Problem, it works if i execute script manually, as i said it works strange when i put the script in /usr/local/etc/rc.d to execute on Startup.

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