Tag Archives: autostart

Gentoo: utorrent autostart

wget http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
tar -zxf utorrent-server-3.0-25053.tar.gz
mv utorrent-server-v3_0/* /home/user/.utorrent/
cat > /etc/init/utorrent.conf
description «utorrent startup script»

start on (local-filesystems and started dbus and stopped udevtrigger)
stop on runlevel [016]

script
cd /home/user/.utorrent
exec su user -c «/home/user/.utorrent/utserver»
end script

ln -s /lib/init/upstart-job /etc/init.d/utorrent

/etc/init.d/utorrent start
update-rc.d utorrent defaults

Fedora: runscript (example: openvpn client)

/etc/init.d/opevpn-home-client

#!/bin/bash
#
# Run-level Startup script for the OpenVPN client
#
# chkconfig: 345 91 19
# description: Startup/Shutdown OpenVPN client 
OVPN_HOME="/home/alter/ovpn/"
case "$1" in
    start)
        echo -n "Starting OpenVPN home client: "
        cd $OVPN_HOME && /usr/sbin/openvpn ovpn.conf
        echo "OK"
        ;;
    stop)
        echo -n "Shutdown OpenVPN home client: "
        killall openvpn
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart"
        exit 1
esac
exit 0
chmod +x /etc/init.d/opevpn-home-client
chkconfig --add openvpn-home-client