Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
script init.d/rtorrent
#!/usr/bin/env bash
# Dépendance : screen, killall et rtorrent
### BEGIN INIT INFO
# Provides: <username>-rtorrent
# Required-Start: $syslog $network
# Required-Stop: $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Start-Stop rtorrent user session
### END INIT INFO
## Début configuration ##
user="<username>"
## Fin configuration ##
rt_start() {
su --command="screen -dmS ${user}-rtorrent rtorrent" "${user}"
}
rt_stop() {
su --command="screen -S ${user}-rtorrent -X quit" "${user}"
}
case "$1" in
start)
echo "Démarrage de rtorrent..."
rt_start
;;
stop)
echo "Arrêt de rtorrent..."
rt_stop
;;
restart)
echo "Redémarrage de rtorrent..."
rt_stop
sleep 1
rt_start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
@Machou

This comment has been minimized.

Copy link

commented Oct 11, 2015

Mettre en français les phrases non ? :D

@PixiBixi

This comment has been minimized.

Copy link

commented Nov 26, 2015

Comme dit le gars, pourquoi ne pas mettre les phrases en FR, ainsi que d'indenter le case ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.