Help Needed (please) with a VERY simple script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tipster69
    Member
    • Dec 2008
    • 91

    #61
    Originally posted by IAmATeaf
    Run the command with an & at the end, that will run the command in the background.
    Hi,

    Could you type out the syntax so I understand how you mean please?


    do you mean /var/script/ping.check.sh& ?

    EDIT: I think I sussed it - /var/script/ping.check.sh &


    THANKS ALOT for that info, it is very helpful.
    Last edited by tipster69; 9 May, 2012, 22:18.

    Comment

    • davvo
      DK Veteran
      • Apr 2009
      • 666

      #62
      handy telnet app to start the script
      is it this one

      App Store - Telnet

      Comment

      • tipster69
        Member
        • Dec 2008
        • 91

        #63
        Hi Davvo,

        I downloaded one last night called Mocha Telnet Lite that I have now set up with a Macro so I only need to press this and it will run the command "/var/script/ping.check.sh &"

        This appears thus far to be working.

        It's just a bit of a shame that I can't have it set up to run from the box "somehow" without relying on an Iphone or a Laptop.

        I thought there may have been a telnet client or "something" that would allow me to run the same command (in the background), via the Box Remote control. Because when I run the script from TSPanel it doesn't allow me to exit the screen, instead I have the pings endlessly scrolling up my TV Screen.

        If you think of anything if you could let me know that would be great.

        THANKS YET AGAIN, FOR ALL YOUR HELP WITH THIS.
        (I know all to many folks on the internet just take and don't show appreciation, I can assure you that I am NOT one of them).

        CHEERS.

        Comment

        • davvo
          DK Veteran
          • Apr 2009
          • 666

          #64
          i tried the telnet app issh duz same thing
          not got a iphone done it on sons ipod touch

          will try and make that script run at boot

          you can run scripts via Remote control
          green button then blue then scripts
          but as you say cant exit screen
          Last edited by davvo; 11 May, 2012, 00:26.

          Comment

          • davvo
            DK Veteran
            • Apr 2009
            • 666

            #65
            ok iv found a way of running the script via the blue button

            put your ping.check.sh in
            /usr/script
            give it 755

            in the script just put this
            ping bbc.co.uk &

            now place the file Ncam_Ping.sh (file is below)
            in
            /usr/camscript
            give it 755

            now press the blue button
            and select ping
            and press ok
            the script will now run

            press the blue button again
            and select cccam or whatever you use
            to watch your channels
            the script will still run in the background

            to stop the script
            go to network on your DM
            and restart network
            the script will then stop running

            this is how i made it
            i got a oscam cam script and edited the file names and path
            which i have highlighted in green
            you could run any script this way

            Code:
            #!/bin/sh
            
            CAMNAME="[COLOR=Lime]PING[/COLOR]"
            
            remove_tmp () {
                rm -rf /tmp/*.info* /tmp/*.tmp*
            }
            
            case "$1" in
                start)
                echo "[SCRIPT] $1: $CAMNAME"
                remove_tmp
                [COLOR=Lime]/usr/script/ping.check.sh[/COLOR] &
                sleep 10
                [COLOR=Lime]/usr/script/[/COLOR]&
                ;;
                stop)
                echo "[SCRIPT] $1: $CAMNAME"
                killall -9  2>/dev/null
                sleep 3
                killall -9 [COLOR=Lime]ping.check.sh[/COLOR] 2>/dev/null
                sleep 3    
                remove_tmp
                ;;
                *)
                $0 stop
                exit 0
                ;;
            esac
            
            exit 0
            Attached Files
            Last edited by davvo; 12 May, 2012, 17:26.

            Comment

            • tipster69
              Member
              • Dec 2008
              • 91

              #66
              Hi Davvo,

              Thanks for your continued efforts on this (above and beyond spring to mind).

              I am just on my way out the door for the weekend but will try this and report back early next week.

              CHEERS

              Comment

              • tipster69
                Member
                • Dec 2008
                • 91

                #67
                Hi,

                I'm unable to test this yet as I have used the 1gb on the SIM Card so will need to order another first.

                CHEERS

                Comment

                • tipster69
                  Member
                  • Dec 2008
                  • 91

                  #68
                  Hi Davvo,

                  I have got my new SIM Card, but because the other way of using the iPhone to Telnet in and start the command is working so well, I don't want to risk ruining it.

                  So I have put the files you have created onto a stick drive for future use if necessary.

                  THANKS AGAIN FOR EVERYTHING.

                  Comment

                  • benji120
                    Newbie
                    • Jun 2012
                    • 1

                    #69
                    tipster69: Does it work?

                    Comment

                    • tipster69
                      Member
                      • Dec 2008
                      • 91

                      #70
                      Hi,

                      Yes, it works very well (using the ping script via telnet on iPhone).

                      Good Luck

                      Comment

                      • rayencool
                        Newbie
                        • Jan 2013
                        • 1

                        #71
                        thanks for this script I needed just

                        Comment

                        • andy91
                          V.I.P. Member
                          • Aug 2010
                          • 3583

                          #72
                          Any updates on this script working with other images like Openpli?

                          Bought a Mifi and with 3g and running this on a mates Dreambox 800hd.

                          TV is watchable but get the odd glitch every 7 or 8 seconds but hoping for a slightly better picture.
                          Was hoping for a simpler option if someone knows of one as my mate isn't very techy

                          Edit-Also have a box running Dream Elite so any help with the script appreciated.

                          Andy
                          Last edited by andy91; 8 May, 2014, 15:31.
                          New Members http://www.digital-kaos.co.uk/fo rums/f5/forum-rules-2/ A Good Place To Start

                          Comment

                          • davvo
                            DK Veteran
                            • Apr 2009
                            • 666

                            #73
                            @andy
                            script to ping every 1 sec for Dream Elite
                            see post 65 above

                            for openpli put the script below in /etc/init.d
                            name it softcam.ping
                            give it 755

                            put ping.check.sh in
                            /usr/script
                            give it 755

                            in the script just put this
                            ping bbc.co.uk &
                            that will ping bbc.co.uk continuously

                            to start the script go to softcams on your image and start the script called ping

                            to stop the script restart network as in post 65






                            Code:
                            #!/bin/sh
                            
                            case "$1" in
                            start)
                                ulimit -s 512
                                exec start-stop-daemon -S -x /usr/script/ping.check.sh &
                                ;;
                            stop)
                                exec start-stop-daemon -K -R 2 -x /usr/script/ping.check.sh &
                                sleep 2
                                killall -9 ping.check.sh 2>/dev/null
                                sleep 2
                                rm -rf /tmp/ping.check.sh
                                ;;
                            restart|reload)
                                $0 stop
                                sleep 1
                                $0 start
                                ;;
                            version)
                                echo "18.50"
                                ;;
                            info)
                                echo "ping.check.sh"
                                ;;
                            *)
                                echo "Usage: $0 start|stop|restart"
                                exit 1
                                ;;
                            esac
                            exit 0
                            Attached Files
                            Last edited by davvo; 9 May, 2014, 00:55.

                            Comment

                            • andy91
                              V.I.P. Member
                              • Aug 2010
                              • 3583

                              #74
                              Think ive done that Davvo not had chance to test it as ive put it on my box and the Mifi is at his.
                              Had a bit of trouble with the Telnet is that the way to check to see if the script is running?
                              Im on Windows 8. I added all the files via Flashfxp and selected Ping like you said followed by my CCcam.
                              Hoping its running any idea how much data this will use?
                              Many thanks for the help.

                              Andy
                              New Members http://www.digital-kaos.co.uk/fo rums/f5/forum-rules-2/ A Good Place To Start

                              Comment

                              • andy91
                                V.I.P. Member
                                • Aug 2010
                                • 3583

                                #75
                                Update sorted out the Dreamelite box but the usb housing at the back is screwed from my lad trying to force Ethernet in No place for the Lan card so screwed that option.
                                Got it going on the Openpli box but ecms seem higher than normal but could be the other thing so will wait and see.

                                Andy
                                New Members http://www.digital-kaos.co.uk/fo rums/f5/forum-rules-2/ A Good Place To Start

                                Comment

                                Working...