#!/bin/bash
#
# /etc/rc.d/init.d/transmission-daemon
#
# Author: Miroslav Pilat
# chkconfig: 2345 13 87
# Description: Bittorrent client Transmission started as daemon
#
# Source function library.
. /etc/init.d/functions
#
# ----- CONFIGURATION -----
#
# For the default location Transmission uses, visit:
# http://trac.transmissionbt.com/wiki/ConfigFiles
# For a guide on how set the preferences, visit:
# http://trac.transmissionbt.com/wiki/EditConfigFiles
# For the available environement variables, visit:
# http://trac.transmissionbt.com/wiki/EnvironmentVariables
#
# The name of the user that should run Transmission.
# It's RECOMENDED to run Transmission in it's own user,
# by default, this is set to 'transmission'.
# For the sake of security you shouldn't set a password
# on this user
USERNAME=transmission
# ----- *ADVANCED* CONFIGURATION -----
# Only change these options if you know what you are doing!
#
# The folder where Transmission stores the config & web files.
# ONLY change this you have it at a non-default location
#TRANSMISSION_HOME="/etc/transmission-daemon"
#TRANSMISSION_WEB_HOME="/usr/share/transmission/web"
#
# The arguments passed on to transmission-daemon.
# ONLY change this you need to, otherwise use the
# settings file as per above.
#TRANSMISSION_ARGS=""
# ----- END OF CONFIGURATION -----
#
# PATH should only include /usr/* if it runs after the mountnfs.sh script.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DESC="bittorrent client"
NAME=transmission-daemon
DAEMON=$(which $NAME)
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Read configuration variable file if it is present
if [ -f /etc/$NAME/$NAME.conf ]; then
. /etc/$NAME/$NAME.conf
fi
start() {
echo -n "Starting $NAME: "
if [ -n "$TRANSMISSION_HOME" ]; then
export TRANSMISSION_HOME
fi
if [ -n "$TRANSMISSION_WEB_HOME" ]; then
export TRANSMISSION_WEB_HOME
fi
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo $NAME already running: $PID
exit 2;
else
daemon $DAEMON $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${NAME}
return $RETVAL
fi
touch /var/lock/subsys/${NAME}
return
}
stop() {
echo -n "Shutting down $NAME: "
killproc $NAME
rm -f /var/lock/subsys/${NAME}
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $NAME
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status}"
exit 1
;;
esac
exit $?
Monday, July 13, 2009
Transmission-deamon Fedora init script
I've recently setup a my old PC as bittorent download station. I use Fedora 11 and I needed transmission-daemon statup script. After some diggig o internet I found only debian like scripts so I decided to write it my self. Here is the result. Use is freely and wisely.
Monday, March 9, 2009
Definitely, Maybe
Seeing this movie and think about Othelo brought me to a thought about "Why we want to see happy ending stories?". I guess it's our life. We think we are having tough times. But that's not true. I believe most of us is having good times. Maybe our expectations are not full-filled but still we are living in times of sufficiency. We have wifes and husbands we love. Adorable, funny, amazing kids. Great parent, family. Social country :D and much more.
And that's why we need to read/watch tragedies. So we can realize how good life we are living. And we should take advice from these unhappy endigs and value what we have.
And that's why we need to read/watch tragedies. So we can realize how good life we are living. And we should take advice from these unhappy endigs and value what we have.
Friday, October 10, 2008
Thoughts about Apple computers
What I like most about Apple is Mac OS X.
The design of their computers is also important for me but not so much.
We own a Mac Mini G4 and we like it but time has come and some parts became defective. The Superdrive and the ethernet port.
So I started to look around for this parts and their prices. During this I looked also to prices of other computers. What a surprise. Most of the PCs are half the price. That's very disappointing. I've also discovered gOS which looks fabulous.
All this makes me think. Are Apple Computers overpriced? Do I really want to pay extra for Apple logo and OSX?
May be if my renter would pay me as he should I would simply buy those faulty parts as external devices + USB Hub and all would be OK.
Money, Money, Money, must be funny in a rich man's world.
The design of their computers is also important for me but not so much.
We own a Mac Mini G4 and we like it but time has come and some parts became defective. The Superdrive and the ethernet port.
So I started to look around for this parts and their prices. During this I looked also to prices of other computers. What a surprise. Most of the PCs are half the price. That's very disappointing. I've also discovered gOS which looks fabulous.
All this makes me think. Are Apple Computers overpriced? Do I really want to pay extra for Apple logo and OSX?
May be if my renter would pay me as he should I would simply buy those faulty parts as external devices + USB Hub and all would be OK.
Money, Money, Money, must be funny in a rich man's world.
Monday, September 15, 2008
Onehundredpushups
I done it after 3 months. I had to do week 6 couple of times more because we were traveling a lot during August and beginning of September and I was not able to follow the plane precisely.
Saturday, July 26, 2008
I bought an iPod
it's been almost three weeks after I've finaly received iPod Touch. I wished to buy an iPod since we moved to Brno. Primary to listen music when going to work. After three years I've finally found enough courage and funds to buy it. It wasn't so easy. I not good at decisions. I thnk long, comparing all versions, looking where to buy it for best value. Petruska, my wife, almost got crazy from my inability to decide. After all it was her who helped me to decide. I would like to thank her now encouragement.
Thank you my dear.
It's a really nice device. Although it's highly under Apple's contoll. People have to hack it to fully unveil it's potential. I still like it. I don't have to fight for some computer time with Petruska. Which was main reason why I decided for Touch. Maybe I will try to develop some app for it also.
But right now I'm going to devote my time to Peruska.
Thank you my dear.
It's a really nice device. Although it's highly under Apple's contoll. People have to hack it to fully unveil it's potential. I still like it. I don't have to fight for some computer time with Petruska. Which was main reason why I decided for Touch. Maybe I will try to develop some app for it also.
But right now I'm going to devote my time to Peruska.
Tuesday, June 10, 2008
Thursday, January 24, 2008
How-to get absolute path of currently executing script
I googled this:
On 2006-06-15, Seb wrote:
> Hello,
> In a script shell (sh, bash, ksh, csh etc), how to get the absolute path
> of the script file's enclosing directory ?
Usually, if you want this, you are doing something wrong, or trying
to solve the wrong problem.
In a POSIX shell (ksh, bash, most recent versions of sh):
progdir=${0%/*}
In a Bourne shell:
progdir=`dirname $0`
Csh is not recommended for scripting.
On 2006-06-15, Seb wrote:
> Hello,
> In a script shell (sh, bash, ksh, csh etc), how to get the absolute path
> of the script file's enclosing directory ?
Usually, if you want this, you are doing something wrong, or trying
to solve the wrong problem.
In a POSIX shell (ksh, bash, most recent versions of sh):
progdir=${0%/*}
In a Bourne shell:
progdir=`dirname $0`
Csh is not recommended for scripting.
Subscribe to:
Posts (Atom)
