Shutdown Script
-
@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 -
@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()
-
@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
-
@Substring
Thanks, but the first line is my fan control, so they cannot be both in custom.sh ? -
@dragu add the fan control in the start then
-
@Substring
Good idea, I will try this out tomorrow. Have nice dreams . -
@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
Tu sais, parfois ces drôles de machines se fouttent tout simplement de notre gueule -
@dragu nan, c'est toujours du pebkac
-
@Substring
J'ai compris pepkac est un synonyme d'Ibm -
This is an english topic
-
@paradadf
You are right, but sometimes the language switching has also some pepkac or ibm issues -
It's working.
I forgot the esac at the end of the script.
Thanks. -
@dragu meh ! Hahaha well done then