diff --git a/README.md b/README.md index 2dc2173..dfd29dd 100644 --- a/README.md +++ b/README.md @@ -53,5 +53,9 @@ $ cd $HOME $ git clone https://github.com/yagop/telegram-bot.git --recursive $ cd telegram-bot/tg $ ./configure && make -$ cd .. && ./launch.sh # Will ask you for a phone number & confirmation code. +$ cd .. +$ sed -i "s/yourusername/$(whoami)/g" etc/telegram.conf +$ sed -i "s_telegrambotpath_$(pwd)_g" etc/telegram.conf +$ sudo cp etc/telegram.conf /etc/init/ +$ ./launch.sh # Will ask you for a phone number & confirmation code. ``` diff --git a/etc/telegram.conf b/etc/telegram.conf index 5e8ca82..bdb4279 100644 --- a/etc/telegram.conf +++ b/etc/telegram.conf @@ -1,9 +1,10 @@ +description "Telegram-bot upstart script" + respawn respawn limit 15 5 start on runlevel [2345] stop on shutdown -script -exec su -s /bin/sh -c /home/yperez/develop/telegram-bot/launch.sh yperez -end script +setuid yourusername +exec /bin/sh telegrambotpath/launch.sh