keroserene / rickrollrc

Rick Astley invades your terminal.
1.38k stars 157 forks source link

Catching kill signal doesn't kill video but kills audio when using ctrl+c #46

Closed jpmvferreira closed 1 year ago

jpmvferreira commented 2 years ago

Hi there, this is not an issue of the script per say I imagine, but I'm trying to setup a more annoying script. I do recognize that injection is brilliant, however, you can always ctrl+c it. Therefore I decided to find a way to block all kill signals.

My solution is therefore as follows:

#!/bin/bash
trap "" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash

However, when I do ctrl+c and rickroll is running, the audio cuts off, but, fortunately, not the video.

I ask all of you, is there a way to make this script even more annoying by not allowing the user to cancel it as easily?

ghost commented 1 year ago

Running the script in the background does the job.

./roll.sh &

You can also use while loop so that even when the script gets closed, it will run again. It will run from start but it will be annoying.

Bash

while true; do ./roll.sh; done

Fish

while true; ./roll.sh; done

Another way is to create a C program run the script from there and ignore all the signals.

jpmvferreira commented 1 year ago

Ah, I'm not sure how I manage to forget that you can run the thing in the background... Thanks! I wasn't aware that you could catch the kill signals in C, thanks for the additional info.