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