Add files via upload

This commit is contained in:
Demonic 2022-02-03 21:59:56 +01:00 committed by GitHub
parent 595562a538
commit c84835c62c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
SHELL/relance_rtorrent.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# A MODIFIER AVEC LES USERS SOUHAITES
users=(stan thomas audrey mickael guenot denis)
for user in ${users[@]}; do
# A ADAPTER AU BESOIN
file=/home/$user/.session/rtorrent.lock
# EXTRACTION DU PID DE RTORRENT DU USER
pid=$(ps -u $user -o pid,command | grep '[0-9] rtorrent$' | cut -d "r" -f1)
# SI RTORRENT EST ACTIF LE PID NE SERA PAS VIDE
if [ ! $pid ];then
# ON SUPPRIME rtorrent.lock CAR CA EMPECHE RTORRENT DE DEMARRER
rm -f $file
# RESTART RTORRENT USER
bash /etc/init.d/$user-rtorrent restart
# LOG
echo "$(date) : le rtorrent de $user a ete redemarre" >> /var/log/rtorrent-check.log
fi
done