scripts/SHELL/SEEDBOX/restart_rtorrent.sh

13 lines
257 B
Bash
Raw Normal View History

2022-05-13 07:34:27 +00:00
#!/bin/bash
2022-05-13 07:34:50 +00:00
while getopts ":u:" opt; do
2022-05-13 07:34:27 +00:00
case "${opt}" in
2022-05-13 07:34:50 +00:00
u) user="${OPTARG}";;
2022-05-13 07:34:27 +00:00
esac
done
2022-05-13 07:34:50 +00:00
# EXTRACTION DU PID DE RTORRENT DU USER
pid=$(ps -u $user -o pid,command | grep '[0-9] rtorrent$' | cut -d "r" -f1)
2022-05-13 07:34:27 +00:00
2022-05-13 07:34:50 +00:00
kill -9 $pid
/root/rtorrent-check