botバックグラウンド起動用bashスクリプト

#!/bin/bash
pkill -f 'cRe5520\.py'
read -p '[ Hit Enter or Ctrl+C ]$ ' -t 10
nohup python3 ./cRe5520.py >/dev/null 2>&1 </dev/null &
echo "system'cRe5520' has started..."

https://gist.github.com/nonkimista/0a437145830f8371758a47198f80adc2

botスクリプトと同じフォルダにこのスクリプトを置いて起動させます。
Enterを押すか10秒経つと、botが起動しバックグラウンドで動き続けます。
botを停止するにはもう一度このスクリプトを走らせて、10秒以内にCtrl+Cを押してください。

ファイル名は適宜、ご自身の環境に合わせましょう。

e.g.

$ bash ./cRe5520.sh
[ Hit Enter or Ctrl+C ]$ 
system'cRe5520' has started...
$ _

$ bash ./cRe5520.sh
[ Hit Enter or Ctrl+C ]$ ^C
$ _

https://note.com/ottimista/n/nd5189f1257bd