case $1 in before) # do here whatever you would like to do right BEFORE # the recording $2 STARTS echo 1 > /sys/class/leds/blue\:ph21\:led1/brightness sudo telegram-cli -W -e "msg \"VDR: Aufnahme $2 gestartet!\"" ;; started) # do here whatever you would like to do right AFTER # the recording $2 STARTED ;; after) # do here whatever you would like to do right AFTER # the recording $2 ENDED echo 0 > /sys/class/leds/blue\:ph21\:led1/brightness chmod -R g+w $2/.. sudo telegram-cli -W -e "msg \"VDR: Aufnahme $2 beendet!\"" ;; edited) # do here whatever you would like to do right AFTER # the recording $2 has been EDITED # $3 is the original recording ;; deleted) # do here whatever you would like to do right AFTER # the recording $2 has been DELETED ;; esac