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

    Online / Offline Status Notification System via push

    Scheduled Pinned Locked Moved Development
    103 Posts 7 Posters 56.2k 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
      hoba
      last edited by

      NAS is somehow confusing. You should try to find a yet unused name imo.

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

        ok renaming it to Router how is that?

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

          I just placed my script on the pfSense Dev image and when I was trying to execute it (bash script i got errors)

          a) No bash ?
          b) no DIR commands?

          I've chaked the bin rirectory and ddint find the command there, so i will try to add them.  But the question is, if i add them therewill they will be included in compiled image?

          also i will neeed those commands:

          1. case
            2)grep
            3)cut
            4)awk
            5)wget
          1 Reply Last reply Reply Quote 0
          • J
            jeroen234
            last edited by

            replace bash shell with tcsh or sh shell
            replace youre wget commands with fetch commands
            all the other commands are all ready in embedded 1.01

            dir is called ls on bsd systems

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

              Ok, so now I know what is a dofference in BSD and Linux.

              "…all the other commands are all ready in embedded 1.01 " I didnt find any dev image for 1.01 so i used 1.0 but i did that long upgrade that it oferred, didnt really the the thing adding the commands but O look again today

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

                Ok skript works now… one thing to get more reliable picture i wnat to check which interface assigned to LAN and WAN, I assome there is a file somwhere that says LAN=eth0 WAN=eth1
                If I can get the interface names i can extract the IP values ... sure I can get them from config file, but i rather get the aluef directly from the OS (besides i have no idea how to make bach script to read XML)

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

                  you may might be able to utilize some code from interfaces>assign or status>interfaces. Both these screens show information on which nic is assigned to which uinterfacename.

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

                    do you refer to PHP pages?

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

                      Yes.

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

                        I'm there now, still cant find the file weher intergface assigments are stored… unles its webguiconfig.in

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

                          $g['varrun_path'] . "/lan.conf.dirty";

                          Is that config I need? what tha value of g[varrun_path]?

                          1 Reply Last reply Reply Quote 0
                          • S
                            sullrich
                            last edited by

                            /etc/inc/globals.inc

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

                              actually I was fullish and miss the part in the main confog file that is cleraly saying LAN=eth1 etc in the XML file, just as usual…. so now im looking on how to read XML w/ bash script... aperantly i have no idea how to do that...

                              1 Reply Last reply Reply Quote 0
                              • S
                                sullrich
                                last edited by

                                Erm, I dont think there is a EASY way to do this.  Good luck!

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

                                  Good, so at the end you wont tell me that my script is too easy :-P

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    sullrich
                                    last edited by

                                    Technically you could call php from your bash script and echo out the values after parsing but this is going to be SLLLOOOW.

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

                                      well besides slow it will eat extra ~15% of CPU, for wrap that is not an option. And in combination to the fact that the script does HTTP request to the external server I definettly dont want to call PHP XML parser… in my case I will have to call it min 2 times and the  3rd will be external HTTP request.

                                      Well lets see what i end up with. Im sure linux/bsd shuld have ability to read xml files.

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        jeroen234
                                        last edited by

                                        lets take a look at it from a difrent side and use the pfsense rules file and get there the lan and wan from

                                        
                                         #!/bin/sh
                                        lan=`awk '/lan = "\{ /{ print $0 }' /tmp/rules.debug | sed -e 's/lan = "{ //' | sed -e 's/ }"//'`
                                        wan=`awk '/wan = "\{ /{ print $0 }' /tmp/rules.debug | sed -e 's/wan = "{ //' | sed -e 's/ }"//'`
                                        echo "lan interface=" $lan
                                        echo "wan interface=" $wan
                                        
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          alexus
                                          last edited by

                                          nice that screept does work.. i was doing almost the same w/ xml just now… but as I see in that example it uses temp dir? is that dor will be included in future releases? is that dir exist in mono, and finally what rules does it refering to? firewall rules? what if NAT is disabled?
                                          Tnx

                                          1 Reply Last reply Reply Quote 0
                                          • J
                                            jeroen234
                                            last edited by

                                            i have made that script on a running pfsense embedded 1.01 soekris
                                            /tmp/rules.debug is the running firewall config of pfsense
                                            mono will have it to i think
                                            nat on or off will not chance the lan of wan interface on the firewall

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