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

Run Script on Interface Status Change (to re-enable 3g usb modem)

Scheduled Pinned Locked Moved General pfSense Questions
5 Posts 2 Posters 1.1k 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.
  • K
    kujina
    last edited by May 12, 2015, 9:30 AM May 11, 2015, 9:11 AM

    Hello I have a Huawei E367 3G Dongle and it regularly drops out (showing a red X in the Interfaces box in the dashboard) unplugging it and plugging it back in fixes it.

    But I did just learn how to power the 3G dongle off and then on with usbconfig -u 4 -a 2 power_off and usbconfig -u 4 -a 2 power_on which gets this connection up and working again!

    What I'd like to do is to automate this usbconfig command with a script, that will run when this interface goes down to get it working again, I'm not familiar with freebsd and so would really appreciate some help.

    Thanks.

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by May 28, 2015, 2:54 PM

      There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

      Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • K
        kujina
        last edited by May 28, 2015, 10:28 PM

        @jimp:

        There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

        Hi Jimp, I appreciate the response. What is devd? Have you seen a script written for this purpose that I could adapt or get adapted?

        …Thanks...

        1 Reply Last reply Reply Quote 0
        • K
          kujina
          last edited by Jun 14, 2015, 8:04 PM

          @jimp:

          There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

          If I was to use Embedded (NanoBSD) could I still use devd or scripting it in PHP?

          1 Reply Last reply Reply Quote 0
          • J
            jimp Rebel Alliance Developer Netgate
            last edited by Jun 18, 2015, 2:24 PM

            Yes, the same mechanisms work on NanoBSD and a full install, the only difference is that if you edit files on the NanoBSD filesystem you have to flip it to Read/Write mode first.

            Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received