Last active
August 29, 2015 14:08
-
-
Save hardware/4224dae971e0d4672cb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CSI="\033[" | |
CEND="${CSI}0m" | |
CGREEN="${CSI}1;32m" | |
CRED="${CSI}1;31m" | |
RTORRENT_PID=$(netstat -tlnp | awk '/:45000 */ {split($NF,a,"/"); print a[1]}') | |
# Vérification du fonctionnement de RTorrent | |
if [[ $RTORRENT_PID -gt 0 ]]; then | |
echo -e "${CGREEN}[OK]${CEND} RTorrent est actuellement en service" | |
else | |
echo -e "${CRED}[KO]${CEND} RTorrent n'est pas en service, démarrage imminent..." | |
/usr/sbin/service <username>-rtorrent start | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment