Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Shutdown Script

    Recalbox General
    script
    6
    25
    8577
    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.
    • lackyluuk
      lackyluuk Translator last edited by lackyluuk

      @Dragu @Substring I am sorry that I didn't reply. I am still here 🙂 Currently I am quite busy with other things as @abunille said. I really hope that there is more time soon. There is still work to do for the wiki :))
      @Dragu I think your proposal is possible. Let me check my config (it's a while ago :D) and then I can give you more information 🙂

      NintendoRS | Nintendo Adapter Box | Cardboard Recalbox

      1 Reply Last reply Reply Quote 0
      • Dragu
        Dragu Banned last edited by Dragu

        @Substring
        I tried something out, probably full of errors.
        I put the stop case in custom.sh together with a call to my other script.

        #!/bin/bash
        
        python /recalbox/share/myscripts/run-fan.py &
        
        stop() {
        python /recalbox/share/myscripts/buzzer.py &
        }
        
        case "$1" in
          stop)
        	stop
        	;;
        

        and for the pin that should be high during shutdown (I use 23).

        #!/usr/bin/env python3
        import os
        import signal
        import sys
        import RPi.GPIO as GPIO
        def setup():
            GPIO.setmode(GPIO.BCM)
            GPIO.setup(23, GPIO.OUT)
            GPIO.setwarnings(False)
            setPin(True)
            return()
        try:
            setup()
        except:
            GPIO.cleanup()
        
        Substring 1 Reply Last reply Reply Quote 0
        • Substring
          Substring @Dragu last edited by

          @dragu if should rather look like

          #!/bin/bash
          
          stop() {
          python /recalbox/share/myscripts/buzzer.py &
          }
          
          case "$1" in
            start)
              ;;
            stop)
          	stop
          	;;
          
          

          Or you're starting twice your script. I added a start "in case" you'd ever need one for later purpose

          Former dev - Please reply with @substring so that i am notified when you answer me
          Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

          1 Reply Last reply Reply Quote 0
          • Dragu
            Dragu Banned last edited by

            @Substring
            Thanks, but the first line is my fan control, so they cannot be both in custom.sh ?

            Substring 1 Reply Last reply Reply Quote 0
            • Substring
              Substring @Dragu last edited by

              @dragu add the fan control in the start then

              Former dev - Please reply with @substring so that i am notified when you answer me
              Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

              1 Reply Last reply Reply Quote 0
              • Dragu
                Dragu Banned last edited by

                @Substring
                Good idea, I will try this out tomorrow. 🙂 Have nice dreams . 😉

                1 Reply Last reply Reply Quote 0
                • Dragu
                  Dragu Banned last edited by Dragu

                  @Substring
                  J'ai testé, il semble que le script ventilo ne fonctionne pas dans le start().
                  Quelque part aussi logique, je présume que c'est juste prévu comme runonce, donc scripts qui s'exécutent seulement une fois.

                  Substring 1 Reply Last reply Reply Quote 0
                  • Substring
                    Substring @Dragu last edited by

                    @dragu custom.sh reçoit start comme paramètre au boot, donc aucune raison que ca ne marche pas

                    Former dev - Please reply with @substring so that i am notified when you answer me
                    Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                    1 Reply Last reply Reply Quote -1
                    • Dragu
                      Dragu Banned last edited by

                      @Substring
                      Tu sais, parfois ces drôles de machines se fouttent tout simplement de notre gueule 😉

                      Substring 1 Reply Last reply Reply Quote 0
                      • Substring
                        Substring @Dragu last edited by

                        @dragu nan, c'est toujours du pebkac 😛

                        Former dev - Please reply with @substring so that i am notified when you answer me
                        Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                        1 Reply Last reply Reply Quote 0
                        • Dragu
                          Dragu Banned last edited by

                          @Substring
                          J'ai compris pepkac est un synonyme d'Ibm 😧

                          1 Reply Last reply Reply Quote 0
                          • paradadf
                            paradadf Staff last edited by

                            This is an english topic 😉

                            If your question was answered, please mark it as solved: Topic Tools -> Ask a question + Topic Tools -> Mark as Solved

                            Dragu 1 Reply Last reply Reply Quote 0
                            • Dragu
                              Dragu Banned @paradadf last edited by

                              @paradadf
                              You are right, but sometimes the language switching has also some pepkac or ibm issues 😉

                              1 Reply Last reply Reply Quote 0
                              • Dragu
                                Dragu Banned last edited by Dragu

                                @Substring

                                It's working.
                                I forgot the esac at the end of the script. 🙂
                                Thanks.

                                Substring 1 Reply Last reply Reply Quote 2
                                • Substring
                                  Substring @Dragu last edited by

                                  @dragu meh ! Hahaha well done then 🙂

                                  Former dev - Please reply with @substring so that i am notified when you answer me
                                  Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  Want to support us ?

                                  78
                                  Online

                                  99.6k
                                  Users

                                  28.1k
                                  Topics

                                  187.1k
                                  Posts

                                  Copyright © 2021 recalbox.com