- echo -n "Starting apt-p2p"
- [ ! -d $rundir ] && mkdir $rundir
- [ ! -f $logfile ] && touch $logfile
- chown $user $rundir $logfile
- [ -f $pidfile ] && chown $user $pidfile
- # Make cache files readable
- umask 022
- start-stop-daemon --start --quiet --exec $twistd -- \
- --pidfile=$pidfile --rundir=$rundir --python=$application \
- --logfile=$logfile --no_save
- echo "."
+ if "$enable"; then
+ echo -n "Starting apt-p2p"
+ [ ! -d $rundir ] && mkdir $rundir
+ [ ! -f $logfile ] && touch $logfile
+ chown $user $rundir $logfile
+ [ -f $pidfile ] && chown $user $pidfile
+ # Make cache files readable
+ umask 022
+ start-stop-daemon --start --quiet --exec $twistd -- \
+ --pidfile=$pidfile --rundir=$rundir --python=$application \
+ --logfile=$logfile --no_save
+ echo "."
+ else
+ echo "apt-p2p daemon not enabled in /etc/default/apt-p2p, not starting..."
+ fi